Platforms to show: All Mac Windows Linux Cross-Platform

XMLParserFilterMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class XML MBS XML Plugin 22.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The XML parser filter class.
Example
// skip all comment nodes while parsing
// MyFilter is a subclass of XMLParserFilterMBS with the acceptNode and getWhatToShow events implemented.
Var parser As New XMLParserMBS
parser.Filter = New MyFilter
Var f As FolderItem = FolderItem.ShowOpenFileDialog("")
If f = Nil Then Return
Var doc As XMLDocumentMBS = parser.parseFile(f)
MessageBox doc.toString

// in MyFilter:
Function acceptNode(node As XMLNodeMBS) As Integer Handles acceptNode
If node IsA XMLCommentMBS Then Return XMLParserFilterMBS.FilterReject
Return XMLParserFilterMBS.FilterAccept
End Function

Function getWhatToShow() As Integer Handles getWhatToShow
Return &hFFFFFFFF // show all node types
End Function

The XMLParserFilterMBS class provide applications the ability to examine nodes as they are being created during the parse process.
And it lets the application decide what nodes should be in the output DOM tree or not.

Filter Actions

Constant Value Description
FilterAccept 1 Accept the node.
FilterInterrupt 4 Interrupt the normal processing of the document.
FilterReject 2 Reject the node and its children.
FilterSkip 3 Skip this single node. 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.


XMLOutputMBS   -   XMLParserMBS


The biggest plugin in space...