JsDomConversions

Conversions between yaidom nodes and JS DOM nodes.

Conversions between yaidom nodes and JS DOM nodes.

Authors

Chris de Vreeze

Value members

Inherited methods

final def convertComment(comment: Comment, doc: Document): Comment

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

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

Inherited from
YaidomToJsDomConversions

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

Inherited from
YaidomToJsDomConversions
final def convertElem(elm: Elem, doc: Document, parentScope: Scope): 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).

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).

Inherited from
YaidomToJsDomConversions

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

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

Inherited from
YaidomToJsDomConversions
final def convertNode(node: Node, doc: Document, parentScope: Scope): 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).

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).

Inherited from
YaidomToJsDomConversions
final def convertProcessingInstruction(processingInstruction: ProcessingInstruction, doc: Document): ProcessingInstruction

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

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

Inherited from
YaidomToJsDomConversions
final def convertText(text: Text, doc: Document): Text

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

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

Inherited from
YaidomToJsDomConversions
final def convertToComment(v: Comment): Comment

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

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

Inherited from
JsDomToYaidomConversions
final def convertToDocument(v: Document): Document

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

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

Inherited from
JsDomToYaidomConversions
final def convertToElem(v: Element, parentScope: Scope): Elem

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

Given a parent scope, converts an org.scalajs.dom.raw.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.

Inherited from
JsDomToYaidomConversions
final def convertToNodeOption(v: Node, parentScope: Scope): Option[Node]

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

Given a parent scope, converts an org.scalajs.dom.raw.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.

Inherited from
JsDomToYaidomConversions
final def convertToProcessingInstruction(v: ProcessingInstruction): ProcessingInstruction

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

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

Inherited from
JsDomToYaidomConversions
final def convertToText(v: Text): Text

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

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

Inherited from
JsDomToYaidomConversions
final def extractAttributes(domAttributes: NamedNodeMap): IndexedSeq[(QName, String)]

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

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

Inherited from
JsDomToYaidomConversions
final def extractNamespaceDeclaration(v: Attr): (Option[String], String)

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

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

Inherited from
JsDomToYaidomConversions
final def extractNamespaceDeclarations(domAttributes: NamedNodeMap): Declarations

Converts the namespace declarations in a NamedNodeMap to a Declarations

Converts the namespace declarations in a NamedNodeMap to a Declarations

Inherited from
JsDomToYaidomConversions
final def extractResolvedAttributes(domAttributes: NamedNodeMap): IndexedSeq[(EName, String)]

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

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

Inherited from
JsDomToYaidomConversions
final def isNamespaceDeclaration(v: Attr): Boolean

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

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

Inherited from
JsDomToYaidomConversions
final def nodeListToIndexedSeq(nodeList: NodeList): IndexedSeq[Node]

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

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

Inherited from
JsDomToYaidomConversions
final def toEName(v: Attr)(enameProvider: ENameProvider): EName

Extracts the EName of an org.scalajs.dom.raw.Attr. If the Attr is a namespace declaration, an exception is thrown.

Extracts the EName of an org.scalajs.dom.raw.Attr. If the Attr is a namespace declaration, an exception is thrown.

Inherited from
JsDomToYaidomConversions
final def toEName(v: Element)(enameProvider: ENameProvider): EName

Extracts the EName of an org.scalajs.dom.raw.Element

Extracts the EName of an org.scalajs.dom.raw.Element

Inherited from
JsDomToYaidomConversions
final def toQName(v: Attr)(qnameProvider: QNameProvider): QName

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

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

Inherited from
JsDomToYaidomConversions
final def toQName(v: Element)(qnameProvider: QNameProvider): QName

Extracts the QName of an org.scalajs.dom.raw.Element

Extracts the QName of an org.scalajs.dom.raw.Element

Inherited from
JsDomToYaidomConversions