Platforms to show: All Mac Windows Linux Cross-Platform

XMLSerializerFilterMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
XMLSerializerMBSFilter provide applications the ability to examine nodes as they are being serialized.
Example
// write an XML document to text, leaving out all comments
// MySerializerFilter is a subclass of XMLSerializerFilterMBS with the events implemented.
Var doc As New XMLDocumentMBS("<config><!-- internal note --><name>Test</name></config>")

Var serializer As New XMLSerializerMBS
serializer.Filter = New MySerializerFilter
MessageBox serializer.writeToString(doc)

// in MySerializerFilter:
Function getWhatToShow() As Integer Handles getWhatToShow
Return XMLDocumentMBS.ShowComment // only ask about comments
End Function

Function acceptNode(node As XMLNodeMBS) As Integer Handles acceptNode
Return XMLSerializerFilterMBS.FilterReject
End Function

XMLSerializerMBSFilter lets the application decide what nodes should be serialized or not.
The XMLDocumentMBS, XMLDocumentTypeMBS, XMLNotationMBS, and XMLEntityMBS nodes are not passed to the filter.

Filter Results

Constant Value Description
FilterAccept 1 Accept the node. Navigation methods defined for XMLNodeIteratorMBS or XMLTreeWalkerMBS will return this node.
FilterReject 2 Reject the node. Navigation methods defined for XMLNodeIteratorMBS or XMLTreeWalkerMBS will not return this node. For XMLTreeWalkerMBS, the children of this node will also be rejected. XMLNodeIteratorMBSs treat this as a synonym for FilterSkip.
FilterSkip 3 Skip this single node. Navigation methods defined for XMLNodeIteratorMBS or XMLTreeWalkerMBS will not return this node. For both XMLNodeIteratorMBS and XMLTreeWalkerMBS, the children of this node will still be considered.

This class has no subclasses.

Some properties using this class:

Some related classes:


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


XMLProcessingInstructionMBS   -   XMLSerializerMBS


The biggest plugin in space...