org.apache.xalan.lib

## Class ExsltSets

- java.lang.Object
- - org.apache.xalan.lib.ExsltBase
  - - org.apache.xalan.lib.ExsltSets

-     public class ExsltSets
      extends ExsltBase

  This class contains EXSLT set extension functions. It is accessed by specifying a namespace URI as follows:

          xmlns:set="http://exslt.org/sets"

  The documentation for each function has been copied from the relevant EXSLT Implementer page.
  See Also:
    EXSLT
  Usage:

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExsltSets()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static NodeList` | `difference(NodeList nl1, NodeList nl2)` The set:difference function returns the difference between two node sets - those nodes that are in the node set passed as the first argument that are not in the node set passed as the second argument.
    `static NodeList` | `distinct(NodeList nl)` The set:distinct function returns a subset of the nodes contained in the node-set NS passed as the first argument.
    `static boolean` | `hasSameNode(NodeList nl1, NodeList nl2)` The set:has-same-node function returns true if the node set passed as the first argument shares any nodes with the node set passed as the second argument.
    `static NodeList` | `intersection(NodeList nl1, NodeList nl2)` The set:intersection function returns a node set comprising the nodes that are within both the node sets passed as arguments to it.
    `static NodeList` | `leading(NodeList nl1, NodeList nl2)` The set:leading function returns the nodes in the node set passed as the first argument that precede, in document order, the first node in the node set passed as the second argument.
    `static NodeList` | `trailing(NodeList nl1, NodeList nl2)` The set:trailing function returns the nodes in the node set passed as the first argument that follow, in document order, the first node in the node set passed as the second argument.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExsltSets

          public ExsltSets()

  - ### Method Detail

    - #### leading

          public static NodeList leading(NodeList nl1,
                         NodeList nl2)

      The set:leading function returns the nodes in the node set passed as the first argument that precede, in document order, the first node in the node set passed as the second argument. If the first node in the second node set is not contained in the first node set, then an empty node set is returned. If the second node set is empty, then the first node set is returned.
      Parameters:
        `nl1` - NodeList for first node-set.
        `nl2` - NodeList for second node-set.
      Returns:
        a NodeList containing the nodes in nl1 that precede in document order the first node in nl2; an empty node-set if the first node in nl2 is not in nl1; all of nl1 if nl2 is empty.
      See Also:
        EXSLT

    - #### trailing

          public static NodeList trailing(NodeList nl1,
                          NodeList nl2)

      The set:trailing function returns the nodes in the node set passed as the first argument that follow, in document order, the first node in the node set passed as the second argument. If the first node in the second node set is not contained in the first node set, then an empty node set is returned. If the second node set is empty, then the first node set is returned.
      Parameters:
        `nl1` - NodeList for first node-set.
        `nl2` - NodeList for second node-set.
      Returns:
        a NodeList containing the nodes in nl1 that follow in document order the first node in nl2; an empty node-set if the first node in nl2 is not in nl1; all of nl1 if nl2 is empty.
      See Also:
        EXSLT

    - #### intersection

          public static NodeList intersection(NodeList nl1,
                              NodeList nl2)

      The set:intersection function returns a node set comprising the nodes that are within both the node sets passed as arguments to it.
      Parameters:
        `nl1` - NodeList for first node-set.
        `nl2` - NodeList for second node-set.
      Returns:
        a NodeList containing the nodes in nl1 that are also in nl2.
      See Also:
        EXSLT

    - #### difference

          public static NodeList difference(NodeList nl1,
                            NodeList nl2)

      The set:difference function returns the difference between two node sets - those nodes that are in the node set passed as the first argument that are not in the node set passed as the second argument.
      Parameters:
        `nl1` - NodeList for first node-set.
        `nl2` - NodeList for second node-set.
      Returns:
        a NodeList containing the nodes in nl1 that are not in nl2.
      See Also:
        EXSLT

    - #### distinct

          public static NodeList distinct(NodeList nl)

      The set:distinct function returns a subset of the nodes contained in the node-set NS passed as the first argument. Specifically, it selects a node N if there is no node in NS that has the same string value as N, and that precedes N in document order.
      Parameters:
        `nl` - NodeList for the node-set.
      Returns:
        a NodeList with nodes from nl containing distinct string values. In other words, if more than one node in nl contains the same string value, only include the first such node found.
      See Also:
        EXSLT

    - #### hasSameNode

          public static boolean hasSameNode(NodeList nl1,
                            NodeList nl2)

      The set:has-same-node function returns true if the node set passed as the first argument shares any nodes with the node set passed as the second argument. If there are no nodes that are in both node sets, then it returns false. The Xalan extensions MethodResolver converts 'has-same-node' to 'hasSameNode'. Note: Not to be confused with hasSameNodes in the Xalan namespace, which returns true if the two node sets contain the exactly the same nodes (perhaps in a different order), otherwise false.
      See Also:
        EXSLT

Copyright © 2014 Apache XML Project. All Rights Reserved.