Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "Utils/XPath"

Index

Functions

computeXPathFromElement

  • computeXPathFromElement(contextNode: Node): XPath
  • Computes the XPath for a given element.

    Implementation details:

    • if the node or a parent has an id attribute, and it is the single node that has this id, then it will be used as the top node of the query.
    • if the node or a parent is a processing instruction, a comment or a DTD, it will throw a TypeError.
    • it will ignore document fragments.

    Parameters

    • contextNode: Node

      the node to compute the XPath from

    Returns XPath

    the XPath

Generated using TypeDoc