Partial DocumentParser
implementation, leaving only one of the parse
methods abstract.
Default ElemProducingSaxHandler implementation.
Document parser.
DOM-based Document
parser.
DOM-LS-based Document
parser.
SAX-based Document
parser.
StAX-based Document
parser.
Contract of a SAX ContentHandler that, once ready, can be asked for the resulting Elem using
method resultingElem
, or the resulting Document using method
resultingDocument
.
Mixin extending DefaultHandler
that contains a Locator
.
Support for parsing XML into yaidom
Document
s andElem
s. This package offers the DocumentParser trait, as well as several implementations. Those implementations use JAXP (SAX, DOM or StAX), and most of them use theconvert
package to convert JAXP artifacts to yaidomDocument
s.For example:
This example chose a SAX-based implementation, and used the default configuration of that document parser.
Having several different fully configurable JAXP-based implementations shows that yaidom is pessimistic about the transparency of parsing and printing XML. It also shows that yaidom is optimistic about the available (heap) memory and processing power, because of the 2 separated steps of JAXP parsing/printing and (in-memory)
convert
conversions. Using JAXP means that escaping of characters is something that JAXP deals with, and that's definitely better than trying to do it yourself.One
DocumentParser
implementation does not use anyconvert
conversion. That isDocumentParserUsingSax
. It is likely the fastest of theDocumentParser
implementations.The preferred
DocumentParser
for XML (not HTML) parsing isDocumentParserUsingDomLS
, if memory usage is not an issue. ThisDocumentParser
implementation is best integrated with DOM, and is highly configurable, although DOM LS configuration is somewhat involved.This package depends on the yaidom and convert packages, and not the other way around.