eu.cdevreeze.yaidom

print

package print

Support for "printing" yaidom Documents and Elems. This package offers the eu.cdevreeze.yaidom.print.DocumentPrinter trait, as well as several implementations. Most of those implementations use the convert package to convert yaidom Documents to JAXP artifacts, and all use JAXP (DOM, SAX or StAX).

For example:

val docPrinter = DocumentPrinterUsingSax.newInstance()

docPrinter.print(doc, "UTF-8", System.out)

This example chose a SAX-based implementation, and used the default configuration of that document printer.

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 DocumentPrinter implementation does not use any convert conversion. That is DocumentPrinterUsingSax. It is likely the fastest of the DocumentPrinter implementations, as well as the one using the least memory.

The preferred DocumentPrinter for XML (not HTML) printing is DocumentPrinterUsingDomLS, if memory usage is not an issue. This DocumentPrinter 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. print
  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 AbstractDocumentPrinter extends DocumentPrinter

    Partial DocumentPrinter implementation.

  2. trait DocumentPrinter extends AnyRef

    eu.cdevreeze.yaidom.simple.Document printer (to the XML as a String or byte array).

  3. final class DocumentPrinterUsingDom extends AbstractDocumentPrinter

    DOM-based Document printer.

  4. final class DocumentPrinterUsingDomLS extends AbstractDocumentPrinter

    DOM-LS-based Document printer.

  5. final class DocumentPrinterUsingSax extends AbstractDocumentPrinter

    SAX-based Document printer.

  6. sealed class DocumentPrinterUsingStax extends AbstractDocumentPrinter

    StAX-based Document printer.

  7. final class ThreadLocalDocumentPrinter extends AbstractDocumentPrinter

    Thread-local DocumentPrinter.

Inherited from AnyRef

Inherited from Any

Ungrouped