Class XPathPatterns

java.lang.Object
eu.bandm.tools.paisley.xml.XPathPatterns

@Generated(generator="eu.bandm.tools.expander", version="1.3.1", timestamp="2026-02-01T13:13:51") public abstract class XPathPatterns extends Object
Library of operations and data structures for pattern-based implementation of the XPath 1.0 language.
  • Method Details

    • node

      public static XPathPatterns.Test node()
      Returns a node test that is true for any node.

      The resulting object represents an XPath expression of the form " node()".

      Returns:
      a node test that is true for any node
    • name

      public static XPathPatterns.Test name(@Opt @Opt String namespaceURI, String localName)
      Returns a node test that is true for any node with the given name.

      The resulting object represents an XPath expression of the form "NCName:NCName", where the part before and after the colon are parsed as a namespace prefix and a local name, respectively. The namespace prefix must be resolved to a namespace URI in application- and context-specific ways before this method can be used.

      Parameters:
      namespaceURI - a namespace URI, or null for a name without a namespace
      localName - a local name
      Returns:
      a node test that is true for any node with the namespace URI equal to namespaceURI and local name equal to localName
      Throws:
      NullPointerException - if localName is null
    • name

      public static XPathPatterns.Test name(String namespaceURI)
      Returns a node test that is true for any node with the given name.

      The resulting object represents an XPath expression of the form "NCName:*", where the part before the colon is parsed as a namespace prefix. The namespace prefix must be resolved to a namespace URI in application- and context-specific ways before this method can be used.

      Parameters:
      namespaceURI - a namespace URI
      Returns:
      a node test that is true for any node in the namespace namespaceURI
      Throws:
      NullPointerException - if namespaceURI is null
    • element

      public static XPathPatterns.Test element()
      Returns a node test that is true for any element node.

      The resulting object represents an XPath expression of the form " *" after an axis specifier whose principal node type is elements.

      Returns:
      a node test that is true for any element node
    • attribute

      public static XPathPatterns.Test attribute()
      Returns a node test that is true for any attribute node.

      The resulting object represents an XPath expression of the form " *" after an axis specifier whose principal node type is attributes.

      Returns:
      a node test that is true for any attribute node
    • text

      public static XPathPatterns.Test text()
      Returns a node test that is true for any text node.

      The resulting object represents an XPath expression of the form " text()".

      Returns:
      a node test that is true for any text node
    • comment

      public static XPathPatterns.Test comment()
      Returns a node test that is true for any comment node.

      The resulting object represents an XPath expression of the form " comment()".

      Returns:
      a node test that is true for any comment node
    • exists

      public static XPathPatterns.Predicate exists(XPathPatterns.Path path)
      Returns a predicate that selects from a node-set the elements for which the given path leads to one or more nodes.
      Parameters:
      path - the path to check
      Returns:
      a predicate that selects-set the elements for which path leads to one or more nodes
      Throws:
      NullPointerException - if path is null
    • position

      public static XPathPatterns.Predicate position(int index)
      Returns a predicate that selects from a node-set the element with the given context position.

      If the given position is less or equal to zero, then the resulting predicate will tacitly select no nodes.

      The resulting object represents an XPath expression of the form "Number".

      Parameters:
      index - the one-based index of the position to be selected
      Returns:
      a predicate that selects-set the element with the context position equal to index
    • last

      public static XPathPatterns.Predicate last()
      Returns a predicate that selects from a node-set the element with the last context position.

      The resulting object represents an XPath expression of the form " last()".

      Returns:
      a predicate that selects-set the element with the last context position
    • absolute

      public static XPathPatterns.Path absolute()
      Returns an empty absolute location path.

      Absolute location paths start at the document root, regardless of the context in which they are evaluated.

      An empty location path does not correspond to any XPath expression; all location paths that can be denoted are non-empty. Empty location paths are useful, however, as the base case in a recursive abstract syntax.

      Returns:
      an empty absolute location path
    • relative

      public static XPathPatterns.Path relative()
      Returns an empty relative location path.

      Relative location paths start at the context node in which they are evaluated.

      An empty location path does not correspond to any XPath expression; all location paths that can be denoted are non-empty. Empty location paths are useful, however, as the base case in a recursive abstract syntax.

      Returns:
      an empty relative location path