Class XMLElement

Hierarchy

Methods

  • set multiple attributes BREAKING CHANGE: no longer overloaded for setting single attr

    Returns

    Parameters

    • attributes: XMLAttributeMap

    Returns XMLElement

  • Parameters

    • xpath: string
    • Optional namespace: XPathNamespace

    Returns xmlXPathObjectPtr

  • Find decendant nodes matching the given xpath selector

    Returns

    array of matching decendant nodes

    Parameters

    • xpath: string

      XPath selector

    • Optional namespace: XPathNamespace

      optional namespace

    Returns XMLXPathNode[]

  • Find the first decendant node matching the given xpath selector

    Returns

    first matching decendant node

    Parameters

    • xpath: string

      XPath selector

    • Optional namespace: XPathNamespace

      optional namespace

    Returns null | string | number | boolean | XMLXPathNode

  • Get the line number that this node starts on in the original parsed document

    Returns

    line number

    Returns number

  • Get the tag name of current node

    Returns

    name

    Parameters

    • Optional value: string

    Returns string

  • Get an array of namespaces that appy to the current node

    Returns

    an array of namespaces for the current node

    Parameters

    • onlyLocal: boolean = false

      whether to include inherited namespaces

    Returns XMLNamespace[]

  • Create a new element with the given name and content, then append it as a child of the current node

    See

    XMLNode.createElement

    Returns

    the appended element

    Parameters

    • name: string
    • Optional content: string

    Returns XMLElement

  • Parameters

    • Optional content: string

    Returns string

  • Get the type of element (XMLElementType)

    "text" | "cdata" | "comment" | "element" | "node"

    Returns

    the node type

    Returns "text" | "document" | "node" | "element" | "attribute" | "cdata" | "entity_ref" | "entity" | "pi" | "comment" | "document_type" | "document_frag" | "notation" | "html_document" | "dtd" | "element_decl" | "attribute_decl" | "entity_decl" | "namespace_decl" | "xinclude_start" | "xinclude_end" | "docb_document"

Generated using TypeDoc