Platforms to show: All Mac Windows Linux Cross-Platform

CFXMLParserMBS.Abort(ErrorCode as Integer, ErrorDescription as CFStringMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Stops parsing from inside an event.
Notes: Cause any in-progress parse to abort with the given error code and description. errorCode must be positive, and errorDescription may not be nil. Cannot be called asynchronously (i.e. must be called from within a parser events).
CFXMLParserMBS.Create(data as CFBinaryDataMBS, url as CFURLMBS, options as Integer)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Creates a new data based parser.
Notes:
Creates a parser which will parse the given data with the given options.
xmlData may not be nil.
dataSource should be the URL from which the data came, and may be nil; it is used to resolve any relative references found in xmlData.

These are the various options you can configure the parser with. These are chosen such that an option flag of 0 (kCFXMLParserNoOptions) leaves the XML as "intact" as possible (reports all structures; performs no replacements).
Hence, to make the parser do the most work, returning only the pure element tree, set the option flag to kCFXMLParserAllOptions:

kCFXMLParserValidateDocument1validate the document against its grammar from the DTD, reporting any errors. Currently not supported.
kCFXMLParserSkipMetaData2silently skip over metadata constructs (the DTD and comments)
kCFXMLParserReplacePhysicalEntities4replace declared entities like <. Note that other than the 5 predefined entities (lt, gt, quot, amp, apos), these must be defined in the DTD. Currently not supported.
kCFXMLParserSkipWhitespace8skip over all whitespace that does not abut non-whitespace character data. In other words, given <foo> <bar> blah </bar></foo>, the whitespace between foo's open tag and bar's open tag would be suppressed, but the whitespace around blah would be preserved.
kCFXMLParserResolveExternalEntities16
kCFXMLParserAddImpliedAttributes32where the DTD specifies implied attribute-value pairs for a particular element, add those pairs to any occurances of the element in the element tree. Currently not supported.
kCFXMLParserAllOptions&hFFFFFF
kCFXMLParserNoOptions0
CFXMLParserMBS.CreateWithDataFromURL(url as CFURLMBS, options as Integer)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Creates a parser which will parse the given data with the given options.
Notes:
The data to be parsed is loaded directly from dataSource. dataSource may not be nil.

These are the various options you can configure the parser with. These are chosen such that an option flag of 0 (kCFXMLParserNoOptions) leaves the XML as "intact" as possible (reports all structures; performs no replacements).
Hence, to make the parser do the most work, returning only the pure element tree, set the option flag to kCFXMLParserAllOptions:

kCFXMLParserValidateDocument1validate the document against its grammar from the DTD, reporting any errors. Currently not supported.
kCFXMLParserSkipMetaData2silently skip over metadata constructs (the DTD and comments)
kCFXMLParserReplacePhysicalEntities4replace declared entities like &lt;. Note that other than the 5 predefined entities (lt, gt, quot, amp, apos), these must be defined in the DTD. Currently not supported.
kCFXMLParserSkipWhitespace8skip over all whitespace that does not abut non-whitespace character data. In other words, given <foo> <bar> blah </bar></foo>, the whitespace between foo's open tag and bar's open tag would be suppressed, but the whitespace around blah would be preserved.
kCFXMLParserResolveExternalEntities16
kCFXMLParserAddImpliedAttributes32where the DTD specifies implied attribute-value pairs for a particular element, add those pairs to any occurances of the element in the element tree. Currently not supported.
kCFXMLParserAllOptions&hFFFFFF
kCFXMLParserNoOptions0
CFXMLParserMBS.Document as CFObjectMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Returns the top-most object returned by the CreateXMLStructure event.
Notes: Returns nil on any error.
CFXMLParserMBS.ErrorDescription as CFStringMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Returns an error description for the last error.
Notes: Returns nil on any error.

Some examples using this method:

CFXMLParserMBS.LineNumber as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Returns the line number of the current parse location.

Some examples using this method:

CFXMLParserMBS.Location as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Returns the character index of the current parse location.
CFXMLParserMBS.Parse as boolean
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: Starts the parser.
Notes:
Starts a parse of the data the parser was created with; returns success (true) or failure (false). Upon success, use the Document function to get the product of the parse. Upon failure, use ErrorCode or ErrorDescription to get information about the error. It is an error to call Parse while a parse is already underway.

Returns false on any error.
CFXMLParserMBS.SourceURL as CFURLMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: The currently used source url for this parser.
Notes: Returns nil on any error.
CFXMLParserMBS.StatusCode as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Function: The last status code.
Notes:
Get the status code (or a user-readable description via ErrorDescription) of the last error that occurred in a parse.
If no error has occurred, a nil description string is returned by ErrorDescription.

kCFXMLStatusParseNotBegun-2
kCFXMLStatusParseInProgress-1
kCFXMLStatusParseSuccessful0
kCFXMLErrorUnexpectedEOF1
kCFXMLErrorUnknownEncoding2
kCFXMLErrorEncodingConversionFailure3
kCFXMLErrorMalformedProcessingInstruction4
kCFXMLErrorMalformedDTD5
kCFXMLErrorMalformedName6
kCFXMLErrorMalformedCDSect7
kCFXMLErrorMalformedCloseTag8
kCFXMLErrorMalformedStartTag9
kCFXMLErrorMalformedDocument10
kCFXMLErrorElementlessDocument11
kCFXMLErrorMalformedComment12
kCFXMLErrorMalformedCharacterReference13
kCFXMLErrorMalformedParsedCharacterData14
kCFXMLErrorNoData15

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

Feedback: Report problem or ask question.

The biggest plugin in space...