@jhulford/libxmljs - v0.0.1-alpha.3
    Preparing search index...

    Class XMLNode

    Hierarchy (View Summary)

    Index

    Methods

    • Return the child at the given index

      Parameters

      • index: number

        the index of the child

      Returns XMLElement | null

      the child to return

    • Create a new element with the given name and content

      Parameters

      • name: string
      • Optionalcontent: string

      Returns XMLElement

      the created element

    • Parameters

      • xpath: string
      • Optionalnamespace: XPathNamespace

      Returns xmlXPathObjectPtr

    • Find decendant nodes matching the given xpath selector

      Parameters

      • xpath: string

        XPath selector

      • Optionalnamespace: XPathNamespace

        optional namespace

      Returns XMLXPathNode[]

      array of matching decendant nodes

    • Find the first decendant node matching the given xpath selector

      Parameters

      • xpath: string

        XPath selector

      • Optionalnamespace: XPathNamespace

        optional namespace

      Returns string | number | boolean | XMLXPathNode | null

      first matching decendant node

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

      Returns number

      line number

    • Get the tag name of current node

      Returns string

      name

    • Get or set the namespace for the current node

      Parameters

      • Optionalprefix: string | XMLNamespace | null

        namespace prefix

      • Optionalhref: string | null

        namespace URL

      Returns XMLNamespace | null

      the current namespace

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

      Parameters

      • onlyLocal: boolean = false

        whether to include inherited namespaces

      Returns XMLNamespace[]

      an array of namespaces for the current node

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

      Parameters

      • name: string
      • Optionalcontent: string

      Returns XMLElement

      the appended element

      XMLNode.createElement

    • Get the previous sibling relative to the current node

      Returns XMLNode | null

      previous element

    • Get the type of element (XMLElementType)

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

      Returns
          | "document"
          | "text"
          | "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"

      the node type