Object

eu.cdevreeze.yaidom.convert

DomConversions

Related Doc: package convert

Permalink

object DomConversions extends YaidomToDomConversions with DomToYaidomConversions

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)
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DomConversions
  2. DomToYaidomConversions
  3. ConverterToDocument
  4. YaidomToDomConversions
  5. DocumentConverter
  6. ElemConverter
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def convertComment(comment: Comment, doc: Document): Comment

    Permalink

    Converts a yaidom Comment to a DOM Comment.

    Converts a yaidom Comment to a DOM Comment. A DOM document is passed as node factory.

    Definition Classes
    YaidomToDomConversions
  7. final def convertDocument(document: Document): DocumentProducer

    Permalink

    Converts a yaidom Document to a function from DOM documents (as node factories) to (filled) DOM documents

    Converts a yaidom Document to a function from DOM documents (as node factories) to (filled) DOM documents

    Definition Classes
    YaidomToDomConversionsDocumentConverter
  8. final def convertElem(elm: Elem, doc: Document, parentScope: Scope): Element

    Permalink

    Converts a yaidom Elem to a DOM element.

    Converts a yaidom Elem to a DOM element. A DOM document is passed as node factory. The passed parent scope is used as follows: the namespace declarations on the result DOM element are: parentScope.relativize(elm.scope).

    Definition Classes
    YaidomToDomConversions
  9. final def convertElem(elm: Elem): ElementProducer

    Permalink

    Same as { doc => convertElem(elm, doc, Scope.Empty) }

    Same as { doc => convertElem(elm, doc, Scope.Empty) }

    Definition Classes
    YaidomToDomConversionsElemConverter
  10. final def convertEntityRef(entityRef: EntityRef, doc: Document): EntityReference

    Permalink

    Converts a yaidom EntityRef to a DOM EntityReference.

    Converts a yaidom EntityRef to a DOM EntityReference. A DOM document is passed as node factory.

    Definition Classes
    YaidomToDomConversions
  11. final def convertNode(node: Node, doc: Document, parentScope: Scope): Node

    Permalink

    Converts a yaidom node to a DOM node.

    Converts a yaidom node to a DOM node. A DOM document is passed as node factory. If the node is an element, the passed parent scope is used as in convertElem(e, doc, parentScope).

    Definition Classes
    YaidomToDomConversions
  12. final def convertProcessingInstruction(processingInstruction: ProcessingInstruction, doc: Document): ProcessingInstruction

    Permalink

    Converts a yaidom ProcessingInstruction to a DOM ProcessingInstruction.

    Converts a yaidom ProcessingInstruction to a DOM ProcessingInstruction. A DOM document is passed as node factory.

    Definition Classes
    YaidomToDomConversions
  13. final def convertText(text: Text, doc: Document): Text

    Permalink

    Converts a yaidom Text to a DOM Text.

    Converts a yaidom Text to a DOM Text. A DOM document is passed as node factory.

    Definition Classes
    YaidomToDomConversions
  14. final def convertToComment(v: Comment): Comment

    Permalink

    Converts an org.w3c.dom.Comment to a eu.cdevreeze.yaidom.simple.Comment

    Converts an org.w3c.dom.Comment to a eu.cdevreeze.yaidom.simple.Comment

    Definition Classes
    DomToYaidomConversions
  15. final def convertToDocument(v: Document): Document

    Permalink

    Converts an org.w3c.dom.Document to a eu.cdevreeze.yaidom.simple.Document.

    Converts an org.w3c.dom.Document to a eu.cdevreeze.yaidom.simple.Document.

    Definition Classes
    DomToYaidomConversionsConverterToDocument
  16. final def convertToElem(v: Element, parentScope: Scope): Elem

    Permalink

    Given a parent scope, converts an org.w3c.dom.Element to a eu.cdevreeze.yaidom.simple.Elem.

    Given a parent scope, converts an org.w3c.dom.Element to a eu.cdevreeze.yaidom.simple.Elem.

    The result Elem gets Scope parentScope.resolve(extractNamespaceDeclarations(v.getAttributes)).

    Be careful: the namespaces inherited by the passed DOM element, if any, are ignored! In other words, the ancestry of the passed DOM element is entirely ignored. This may cause an exception to be thrown, if there are indeed such namespaces, unless they are a subset of the passed parent scope.

    Definition Classes
    DomToYaidomConversions
  17. final def convertToEntityRef(v: EntityReference): EntityRef

    Permalink

    Converts an org.w3c.dom.EntityReference to a eu.cdevreeze.yaidom.simple.EntityRef

    Converts an org.w3c.dom.EntityReference to a eu.cdevreeze.yaidom.simple.EntityRef

    Definition Classes
    DomToYaidomConversions
  18. final def convertToNodeOption(v: Node, parentScope: Scope): Option[Node]

    Permalink

    Given a parent scope, converts an org.w3c.dom.Node to an optional eu.cdevreeze.yaidom.simple.Node.

    Given a parent scope, converts an org.w3c.dom.Node to an optional eu.cdevreeze.yaidom.simple.Node.

    In case of an element, the result Elem (wrapped in an Option) gets Scope parentScope.resolve(extractNamespaceDeclarations(v.getAttributes)).

    Be careful: the namespaces inherited by the passed DOM node, if any, are ignored! In other words, the ancestry of the passed DOM node is entirely ignored. This may cause an exception to be thrown, if there are indeed such namespaces, unless they are a subset of the passed parent scope.

    Definition Classes
    DomToYaidomConversions
  19. final def convertToProcessingInstruction(v: ProcessingInstruction): ProcessingInstruction

    Permalink

    Converts an org.w3c.dom.ProcessingInstruction to a eu.cdevreeze.yaidom.simple.ProcessingInstruction

    Converts an org.w3c.dom.ProcessingInstruction to a eu.cdevreeze.yaidom.simple.ProcessingInstruction

    Definition Classes
    DomToYaidomConversions
  20. final def convertToText(v: Text): Text

    Permalink

    Converts an org.w3c.dom.Text to a eu.cdevreeze.yaidom.simple.Text

    Converts an org.w3c.dom.Text to a eu.cdevreeze.yaidom.simple.Text

    Definition Classes
    DomToYaidomConversions
  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def extractAttributes(domAttributes: NamedNodeMap): IndexedSeq[(QName, String)]

    Permalink

    Converts a NamedNodeMap to an immutable.IndexedSeq[(QName, String)].

    Converts a NamedNodeMap to an immutable.IndexedSeq[(QName, String)]. Namespace declarations are skipped.

    Definition Classes
    DomToYaidomConversions
  24. final def extractNamespaceDeclaration(v: Attr): (Option[String], String)

    Permalink

    Extracts (optional) prefix and namespace.

    Extracts (optional) prefix and namespace. Call only if isNamespaceDeclaration(v), since otherwise an exception is thrown.

    Definition Classes
    DomToYaidomConversions
  25. final def extractNamespaceDeclarations(domAttributes: NamedNodeMap): Declarations

    Permalink

    Converts the namespace declarations in a NamedNodeMap to a Declarations

    Converts the namespace declarations in a NamedNodeMap to a Declarations

    Definition Classes
    DomToYaidomConversions
  26. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  28. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  30. final def isNamespaceDeclaration(v: Attr): Boolean

    Permalink

    Returns true if the org.w3c.dom.Attr is a namespace declaration

    Returns true if the org.w3c.dom.Attr is a namespace declaration

    Definition Classes
    DomToYaidomConversions
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. final def nodeListToIndexedSeq(nodeList: NodeList): IndexedSeq[Node]

    Permalink

    Helper method that converts a NodeList to an IndexedSeq[org.w3c.dom.Node]

    Helper method that converts a NodeList to an IndexedSeq[org.w3c.dom.Node]

    Definition Classes
    DomToYaidomConversions
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. final def toQName(v: Attr)(implicit qnameProvider: QNameProvider): QName

    Permalink

    Extracts the QName of an org.w3c.dom.Attr.

    Extracts the QName of an org.w3c.dom.Attr. If the Attr is a namespace declaration, an exception is thrown.

    Definition Classes
    DomToYaidomConversions
  37. final def toQName(v: Element)(implicit qnameProvider: QNameProvider): QName

    Permalink

    Extracts the QName of an org.w3c.dom.Element

    Extracts the QName of an org.w3c.dom.Element

    Definition Classes
    DomToYaidomConversions
  38. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  39. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DomToYaidomConversions

Inherited from ConverterToDocument[Document]

Inherited from YaidomToDomConversions

Inherited from ElemConverter[ElementProducer]

Inherited from AnyRef

Inherited from Any

Ungrouped