IP*Works! V9 - Online Help
IP*Works! V9
Questions / Feedback?

XMLp Bean

Properties   Methods   Events   Configuration Settings   Errors  

The XMLp component implements a SAX2-compliant XML parser with XPath DOM traversal that can be used to parse and verify the structure of XML documents.

Syntax

IPWorks.Xmlp

Remarks

The XMLp bean parses XML documents and verifies that they are well-formed. The results are provided through a set of events complying with the SAX2 specification.

In addition, the document structure may be queried through an XPath mechanism that supports a subset of the XPath specification.

The parser is optimized for read applications, with a very fast engine that builds internal DOM structures with close to zero heap allocations.

The bean takes pieces of XML code through the Input method, until Flush is called. The document is parsed and fires events like StartElement, EndElement, Characters, IgnorableWhitespace, PI, etc. Entities are evaluated inside the EvalEntity event. If BuildDOM is set to True, an internal DOM structure is created, which in turn enables properties such as XPath, XElement, XText, etc. which allow traversal of the document structure.

When XPath is set to a valid path, XElement points to the name of the element, with XParent, XNamespace, XPrefix, XChildren, and XText providing other properties of the element. The XAttributes collection provides the attributes of the current element.

An additional "relaxed" mode allows for lexical parsing of non-XML documents (e.g. HTML). This is enabled by setting Validate to False. In this case, events will be fired as elements, entities, etc. are encountered, but the structure of the document will not be checked for "well-formedness", and the internal DOM structure will not be built.

Property List


The following is the full list of the properties of the bean with short descriptions. Click on the links for further details.

BuildDOMWhen True, an internal object model of the XML document is created.
ExtraNameCharsExtra characters for the parser to consider as name characters.
ExtraSpaceCharsExtra characters for the parser to consider as white space.
FlushOnEOLIf set, the parser flushes its text buffer after every line of text.
NamespacesCollection of namespaces in the current namespace stack.
OffsetCurrent offset of the document being parsed.
ValidateWhen True, the parser checks that the document consists of well-formed XML.
XAttributesA collection of attributes of the current element.
XChildrenCollection of child elements of the current element.
XElementThe name of the current element.
XNamespaceThe namespace of the current element.
XParentThe parent of the current element.
XPathProvides a way to point to a specific element in the document.
XPrefixThe prefix of the current element.
XSubTreeA snapshot of the current element in the document.
XTextThe text of the current element.

Method List


The following is the full list of the methods of the bean with short descriptions. Click on the links for further details.

attrReturns the value of the specified attribute.
configSets or retrieves a configuration setting .
flushFlushes the parser and checks its end state.
hasXPathDetermines whether a specific element exists in the document.
inputProvides input to the parser.
loadDOMLoads the DOM from a file.
parseFileParses the file specified by FileName.
resetResets the parser.
saveDOMSaves the DOM to a file.

Event List


The following is the full list of the events fired by the bean with short descriptions. Click on the links for further details.

CharactersFired for plain text segments of the input stream.
CommentFired when a comment section is encountered.
EndElementFired when an end-element tag is encountered.
EndPrefixMappingFired when leaving the scope of a namespace declaration.
ErrorInformation about errors during data delivery.
EvalEntityFired every time an entity needs to be evaluated.
IgnorableWhitespaceFired when a section of ignorable whitespace is encountered.
MetaFired when a meta section is encountered.
PIFired when a processing instruction section is encountered.
SpecialSectionFired when a special section is encountered.
StartElementFired when a begin-element tag is encountered in the document.
StartPrefixMappingFired when entering the scope of a namespace declaration.

Configuration Settings


The following is a list of configuration settings for the bean with short descriptions. Click on the links for further details.

IgnoreBadAttributePrefixesIf true, bad (unknown) attribute prefixes are ignored.
IgnoreBadElementPrefixesIf true, bad (unknown) element prefixes are ignored.
CacheContentIf true, the original XML is saved in a buffer.
ErrorOnEmptyAttrIf true, passing an invalid attribute to the Attr method will throw an exception.
PreserveWhitespaceIf true, leading and trailing whitespace in element text is preserved.
CodePageThe system code page used for Unicode to Multibyte translations.

 
 
Copyright (c) 2018 /n software inc. - All rights reserved.
Build 9.0.6635.0