APIdia Launch Partner
Top Description Constructors Methods
com.sun.org.apache.xalan.internal.lib

public Class ExsltSets

extends ExsltBase
Class Inheritance
Imports
com.sun.org.apache.xml.internal.utils.DOM2Helper, com.sun.org.apache.xpath.internal.NodeSet, java.util.HashMap, .Map, org.w3c.dom.Node, .NodeList

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static NodeList

Returns:

a NodeList containing the nodes in nl1 that are not in nl2.
difference
(NodeList
NodeList for first node-set.
nl1
,
NodeList
NodeList for second node-set.
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.

public static NodeList

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.
distinct
(NodeList
NodeList for the node-set.
nl
)

The set:distinct function returns a subset of the nodes contained in the node-set NS passed as the first argument.

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.

public static NodeList

Returns:

a NodeList containing the nodes in nl1 that are also in nl2.
intersection
(NodeList
NodeList for first node-set.
nl1
,
NodeList
NodeList for second node-set.
nl2
)

The set:intersection function returns a node set comprising the nodes that are within both the node sets passed as arguments to it.

public static NodeList

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.
leading
(NodeList
NodeList for first node-set.
nl1
,
NodeList
NodeList for second node-set.
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.

public static NodeList

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.
trailing
(NodeList
NodeList for first node-set.
nl1
,
NodeList
NodeList for second node-set.
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.

Inherited from com.sun.org.apache.xalan.internal.lib.ExsltBase:
toNumbertoString

Constructor Detail

ExsltSetsback to summary
public ExsltSets()

Method Detail

differenceback to summary
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

NodeList for first node-set.

nl2:NodeList

NodeList for second node-set.

Returns:NodeList

a NodeList containing the nodes in nl1 that are not in nl2.

See Also
EXSLT
distinctback to summary
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

NodeList for the node-set.

Returns:NodeList

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
hasSameNodeback to summary
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
intersectionback to summary
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

NodeList for first node-set.

nl2:NodeList

NodeList for second node-set.

Returns:NodeList

a NodeList containing the nodes in nl1 that are also in nl2.

See Also
EXSLT
leadingback to summary
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

NodeList for first node-set.

nl2:NodeList

NodeList for second node-set.

Returns:NodeList

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
trailingback to summary
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

NodeList for first node-set.

nl2:NodeList

NodeList for second node-set.

Returns:NodeList

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