eu.cdevreeze.yaidom

parse

package parse

Support for parsing XML into yaidom Documents and Elems. This package offers the eu.cdevreeze.yaidom.parse.DocumentParser trait, as well as several implementations. Those implementations use JAXP (SAX, DOM or StAX), and most of them use the convert package to convert JAXP artifacts to yaidom Documents.

For example:

val docParser = DocumentParserUsingSax.newInstance()

val doc: Document = docParser.parse(docUri)

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 any convert conversion. That is DocumentParserUsingSax. It is likely the fastest of the DocumentParser implementations.

The preferred DocumentParser for XML (not HTML) parsing is DocumentParserUsingDomLS, if memory usage is not an issue. This DocumentParser implementation is best integrated with DOM, and is highly configurable, although DOM LS configuration is somewhat involved.

This package depends on the eu.cdevreeze.yaidom.core, eu.cdevreeze.yaidom.queryapi, eu.cdevreeze.yaidom.simple and eu.cdevreeze.yaidom.convert packages, and not the other way around.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. parse
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AbstractDocumentParser extends DocumentParser

    Partial DocumentParser implementation, leaving only one of the parse methods abstract.

  2. trait DefaultElemProducingSaxHandler extends DefaultHandler with ElemProducingSaxHandler with LexicalHandler with SaxHandlerWithLocator

    Default eu.cdevreeze.yaidom.parse.ElemProducingSaxHandler implementation.

  3. trait DocumentParser extends AnyRef

    eu.cdevreeze.yaidom.simple.Document parser.

  4. final class DocumentParserUsingDom extends AbstractDocumentParser

    DOM-based Document parser.

  5. final class DocumentParserUsingDomLS extends AbstractDocumentParser

    DOM-LS-based Document parser.

  6. final class DocumentParserUsingSax extends AbstractDocumentParser

    SAX-based Document parser.

  7. final class DocumentParserUsingStax extends AbstractDocumentParser

    StAX-based Document parser.

  8. trait ElemProducingSaxHandler extends DefaultHandler

    Contract of a SAX ContentHandler that, once ready, can be asked for the resulting eu.cdevreeze.yaidom.simple.Elem using method resultingElem, or the resulting eu.cdevreeze.yaidom.simple.Document using method resultingDocument.

  9. trait SaxHandlerWithLocator extends DefaultHandler

    Mixin extending DefaultHandler that contains a Locator.

  10. final class ThreadLocalDocumentParser extends AbstractDocumentParser

    Thread-local DocumentParser.

Inherited from AnyRef

Inherited from Any

Ungrouped