Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "wed/convert"

Index

Variables

Const XML1_NAMESPACE

XML1_NAMESPACE: string = "http://www.w3.org/XML/1998/namespace"

Const XMLNS_NAMESPACE

XMLNS_NAMESPACE: string = "http://www.w3.org/2000/xmlns/"

Functions

normalizeNS

  • normalizeNS(ns: string | null): string

toHTMLTree

  • toHTMLTree(doc: Document, node: Node): Node
  • Convert an XML tree or subtree into an HTML tree suitable to be inserted into the GUI tree.

    XML Elements are converted to div elements with a class that has:

    • for first class the tag name (qualified name in XML parlance) of the element,

    • for second class the _local_<local name> where <local name> is the local name of the element,

    • for third class _xmlns_<namespace uri> where namespace uri is the URI of the namespace of the XML element,

    • for fourth class _real.

    The attributes of the XML element appear on the HTML element with the name data-wed-<attribute name>, where attribute name is converted by encodeAttrName. This attribute has for value the original value in the XML. A second attribute data-wed--ns-<attribute name> contains the namespace URI of the attribute. If the attribute was not in a namespace, then data-wed--ns-<attribute name> is omitted.

    Parameters

    • doc: Document

      The HTML document in which we are going to use the generated tree.

    • node: Node

      The root of the XML tree to convert.

    Returns Node

    The root of the newly created HTML tree.

Generated using TypeDoc