Package

eu.cdevreeze.yaidom

convert

Permalink

package convert

Support for conversions from/to yaidom. This package mostly contains conversions between yaidom objects and JAXP DOM or StAX objects, in both directions.

This conversion support is used by the Document parsers and printers in the parse and print packages, respectively. This package can also be used directly by consumers of the yaidom API.

These JAXP-object conversions suggest that yaidom is optimistic about the available (heap) memory.

This package depends on the eu.cdevreeze.yaidom.core, eu.cdevreeze.yaidom.queryapi and eu.cdevreeze.yaidom.simple packages, and not the other way around. The eu.cdevreeze.yaidom.parse and eu.cdevreeze.yaidom.print packages depend on this package.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. convert
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. trait DomToYaidomConversions extends ConverterToDocument[Document]

    Permalink

    Converter from DOM nodes to yaidom nodes, in particular from org.w3c.dom.Element to eu.cdevreeze.yaidom.simple.Elem and from org.w3c.dom.Document to eu.cdevreeze.yaidom.simple.Document.

    Converter from DOM nodes to yaidom nodes, in particular from org.w3c.dom.Element to eu.cdevreeze.yaidom.simple.Elem and from org.w3c.dom.Document to eu.cdevreeze.yaidom.simple.Document.

    This converter regards the input more like an "ElemBuilder" than an "Elem", in that namespace declarations instead of scopes are extracted from input "elements", and in that conversions to yaidom Elems take an additional parent scope parameter (against which namespace declarations are resolved to get the scope of the yaidom element).

  2. trait ScalaXmlToYaidomConversions extends ConverterToDocument[Document] with ConverterToElem[Elem]

    Permalink

    Converter from Scala XML nodes to yaidom nodes, in particular from scala.xml.Elem to eu.cdevreeze.yaidom.simple.Elem and from scala.xml.Document to eu.cdevreeze.yaidom.simple.Document.

    Converter from Scala XML nodes to yaidom nodes, in particular from scala.xml.Elem to eu.cdevreeze.yaidom.simple.Elem and from scala.xml.Document to eu.cdevreeze.yaidom.simple.Document.

    This converter is handy when one wants to use XML literals (as offered by standard Scala XML) in combination with yaidom.

    This converter regards the input more like an "Elem" than an "ElemBuilder", in that scopes instead of namespace declarations are extracted from input "elements", and in that conversions to yaidom Elems do not take any additional parent scope parameter. On the other hand, Scala XML NamespaceBindings try to be a bit of both yaidom Scopes and yaidom Declarations.

    Beware that conversions from Scala XML Elems to yaidom Elems will fail if the Scala XML Elem uses namespaces in element and/or attribute names that have not been declared!

  3. trait StaxEventsToYaidomConversions extends ConverterToDocument[Iterator[XMLEvent]]

    Permalink

    Converter from StAX events to yaidom nodes, in particular from immutable.IndexedSeq[XMLEvent] to eu.cdevreeze.yaidom.simple.Elem and to eu.cdevreeze.yaidom.simple.Document.

    Converter from StAX events to yaidom nodes, in particular from immutable.IndexedSeq[XMLEvent] to eu.cdevreeze.yaidom.simple.Elem and to eu.cdevreeze.yaidom.simple.Document.

    There are also analogous conversions that take an Iterator[XMLEvent] instead. These can be used to reduce memory usage.

    This converter regards the input event stream more like an "ElemBuilder" than an "Elem", in that namespace declarations instead of scopes are extracted from input "elements", and in that conversions to yaidom Elems take an additional parent scope parameter (against which namespace declarations are resolved to get the scope of the yaidom element).

  4. trait YaidomToDomConversions extends ElemConverter[ElementProducer] with DocumentConverter[DocumentProducer]

    Permalink

    Converter from yaidom nodes to DOM nodes, in particular from eu.cdevreeze.yaidom.simple.Elem to a org.w3c.dom.Element, and from eu.cdevreeze.yaidom.simple.Document to a org.w3c.dom.Document.

  5. trait YaidomToSaxEventsConversions extends ElemConverter[SaxEventsProducer] with DocumentConverter[SaxEventsProducer]

    Permalink

    Converter from yaidom nodes to SAX event producers, in particular from eu.cdevreeze.yaidom.simple.Elem to SaxEventsProducer, and from eu.cdevreeze.yaidom.simple.Document to SaxEventsProducer.

  6. trait YaidomToScalaXmlConversions extends ElemConverter[Elem]

    Permalink

    Converter from yaidom nodes to Scala XML nodes, in particular from eu.cdevreeze.yaidom.simple.Elem to a scala.xml.Elem.

    Converter from yaidom nodes to Scala XML nodes, in particular from eu.cdevreeze.yaidom.simple.Elem to a scala.xml.Elem.

    There is no conversion from yaidom Documents to Scala XML documents, because there is no direct way to create Scala XML documents.

  7. trait YaidomToStaxEventsConversions extends ElemConverter[XmlEventsProducer] with DocumentConverter[XmlEventsProducer]

    Permalink

    Converter from yaidom nodes to StAX events, in particular from eu.cdevreeze.yaidom.simple.Elem to immutable.IndexedSeq[XMLEvent], and from eu.cdevreeze.yaidom.simple.Document to immutable.IndexedSeq[XMLEvent].

Value Members

  1. object DomConversions extends YaidomToDomConversions with DomToYaidomConversions

    Permalink

    Conversions between yaidom nodes and DOM nodes.

    Conversions between yaidom nodes and DOM nodes.

    These conversions are used in implementations of yaidom XML parsers and printers. They are also useful in application code. One scenario in which these conversions are useful is as follows:

    val dbf = DocumentBuilderFactory.newInstance
    val db = dbf.newDocumentBuilder
    val domDoc = db.parse(inputFile)
    
    editDomTreeInPlace(domDoc)
    
    val doc = DomConversions.convertToDocument(domDoc)
    
    useImmutableDoc(doc)
  2. object ScalaXmlConversions extends YaidomToScalaXmlConversions with ScalaXmlToYaidomConversions

    Permalink

    Conversions between yaidom nodes and Scala XML nodes.

    Conversions between yaidom nodes and Scala XML nodes.

    These conversions are handy when one wants to use XML literals (as offered by standard Scala XML) in combination with yaidom.

    Example usage:

    val scalaXmlElem = <a xmlns="http://a"><b><c>test</c></b></a>
    
    val elem = ScalaXmlConversions.convertToElem(scalaXmlElem)
    
    useImmutableElem(elem)

    See eu.cdevreeze.yaidom.convert.YaidomToScalaXmlConversions and in particular eu.cdevreeze.yaidom.convert.ScalaXmlToYaidomConversions for some pitfalls and peculiarities when using these conversions.

  3. object StaxConversions extends YaidomToStaxEventsConversions with StaxEventsToYaidomConversions

    Permalink

    Conversions between yaidom nodes and StAX events.

    Conversions between yaidom nodes and StAX events.

    These conversions are used in implementations of yaidom XML parsers and printers. They are also useful in application code.

  4. object StaxEventsToYaidomConversions

    Permalink
  5. object YaidomToDomConversions

    Permalink
  6. object YaidomToSaxEventsConversions

    Permalink
  7. object YaidomToStaxEventsConversions

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped