vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Function getNode

    • Find the first node in a XML string matching the specified path. The path is a dot separated list of tags and can include a index number to select a specific node.

      Parameters

      • xml: string

        XML string or buffer

      • path: string

        Dot separated path to the node

      Returns undefined | Node

      Node or undefined if not found

      Returns the first inner node of rootTag:

      const xml = `<rootTag> <inner /> <inner /> </rootTag>`;
      const tag = getNode(xml, 'rootTag.inner|1');