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 package does not support conversions between different yaidom element implementations. It is too low level a package for that.
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.
- Alphabetic
- By Inheritance
- convert
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait JsDomToYaidomConversions extends ConverterToDocument[Document]
Converter from JS DOM nodes to yaidom nodes, in particular from
org.scalajs.dom.raw.Element
toeu.cdevreeze.yaidom.simple.Elem
and fromorg.scalajs.dom.raw.Document
toeu.cdevreeze.yaidom.simple.Document
.Converter from JS DOM nodes to yaidom nodes, in particular from
org.scalajs.dom.raw.Element
toeu.cdevreeze.yaidom.simple.Elem
and fromorg.scalajs.dom.raw.Document
toeu.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).
- trait ScalaXmlToYaidomConversions extends ConverterToDocument[Document] with ConverterToElem[Elem]
Converter from Scala XML nodes to yaidom nodes, in particular from
scala.xml.Elem
to eu.cdevreeze.yaidom.simple.Elem and fromscala.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 fromscala.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!
- trait YaidomToJsDomConversions extends ElemConverter[ElementProducer] with DocumentConverter[DocumentProducer]
Converter from yaidom nodes to DOM nodes, in particular from eu.cdevreeze.yaidom.simple.Elem to a
org.scalajs.dom.raw.Element
, and from eu.cdevreeze.yaidom.simple.Document to aorg.scalajs.dom.raw.Document
. - trait YaidomToScalaXmlConversions extends ElemConverter[Elem]
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.
Value Members
- object JsDomConversions extends YaidomToJsDomConversions with JsDomToYaidomConversions
Conversions between yaidom nodes and JS DOM nodes.
- object ScalaXmlConversions extends YaidomToScalaXmlConversions with ScalaXmlToYaidomConversions
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.
- object YaidomToJsDomConversions