Platforms to show: All Mac Windows Linux Cross-Platform

Back to XMLSerializerMBS class.

XMLSerializerMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.

XMLSerializerMBS.writeToBuffer(Node as XMLNodeMBS, output as XMLOutputMBS) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Write out the specified node as described above in the description of XMLSerializerMBS.
Example

// parse it
Dim doc As New XMLDocumentMBS("<test id=""123""><f>1</f><f>2</f><f>3</f><f>4</f></test>")

// create serializer
Dim serializer As New XMLSerializerMBS

// options
serializer.NewLine = EndOfLine.macOS

Dim output As New XMLOutputMBS
output.Encoding = "UTF-8"

// and output to string
Dim s As String = serializer.writeToBuffer(doc, output)

Writing a Document or Entity node produces a serialized form that is well formed XML. Writing other node types produces a fragment of text in a form that is not fully defined by this document, but that should be useful to a human for debugging or diagnostic purposes.

node: The Document or Entity node to be written. For other node types, something sensible should be written, but the exact serialized form is not specified.
output: The output for the data to be written.

Returns XML if node was successfully serialized and false in case a failure occured and the failure wasn't canceled by the error handler.

We internally create a memory buffer to output to and return you the output.

XMLSerializerMBS.writeToFile(Node as XMLNodeMBS, File as FolderItem) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Write out the specified node as described above in the description of XMLSerializerMBS.
Example

// parse it
Dim doc As New XMLDocumentMBS("<test id=""123""><f>1</f><f>2</f><f>3</f><f>4</f></test>")

// create serializer
Dim serializer As New XMLSerializerMBS

Dim file As FolderItem = SpecialFolder.Desktop.Child("test.xml")

// and output to string
Dim r As Boolean = serializer.writeToFile(doc, file)

Writing a Document or Entity node produces a serialized form that is well formed XML. Writing other node types produces a fragment of text in a form that is not fully defined by this document, but that should be useful to a human for debugging or diagnostic purposes.

node: The Document or Entity node to be written. For other node types, something sensible should be written, but the exact serialized form is not specified.
uri: The destination for the data to be written.

Returns true if node was successfully serialized and false in case a failure occured and the failure wasn't canceled by the error handler.

XMLSerializerMBS.writeToString(Node as XMLNodeMBS) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Serialize the specified node as described above in the description of XMLSerializerMBS.
Example

// parse it
Dim doc As New XMLDocumentMBS("<test id=""123""><f>1</f><f>2</f><f>3</f><f>4</f></test>")

// create serializer
Dim serializer As New XMLSerializerMBS

// options
serializer.NewLine = EndOfLine.macOS

// and output to string
Dim s As String = serializer.writeToString(doc)

The result of serializing the node is returned as a string. Writing a Document or Entity node produces a serialized form that is well formed XML. Writing other node types produces a fragment of text in a form that is not fully defined by this document, but that should be useful to a human for debugging or diagnostic purposes.

node: The node to be written.

Returns the serialized data, or "" in case a failure occured and the failure wasn't canceled by the error handler. The returned string is always marked as UTF-16.

XMLSerializerMBS.writeToURI(Node as XMLNodeMBS, URI as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Write out the specified node as described above in the description of XMLSerializerMBS.
Example

// parse it
Dim doc As New XMLDocumentMBS("<test id=""123""><f>1</f><f>2</f><f>3</f><f>4</f></test>")

// create serializer
Dim serializer As New XMLSerializerMBS

Dim file As FolderItem = SpecialFolder.Desktop.Child("test.xml")

// and output to string
Dim r As Boolean = serializer.writeToURI(doc, file.NativePath)

Writing a Document or Entity node produces a serialized form that is well formed XML. Writing other node types produces a fragment of text in a form that is not fully defined by this document, but that should be useful to a human for debugging or diagnostic purposes.

node: The Document or Entity node to be written. For other node types, something sensible should be written, but the exact serialized form is not specified.
uri: The destination for the data to be written.

Returns true if node was successfully serialized and false in case a failure occured and the failure wasn't canceled by the error handler.

The items on this page are in the following plugins: MBS XML Plugin.


The biggest plugin in space...