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

public Class Extensions

extends Object
Class Inheritance
Imports
java.util.StringTokenizer, com.sun.org.apache.xalan.internal.extensions.ExpressionContext, com.sun.org.apache.xpath.internal.NodeSet, com.sun.org.apache.xpath.internal.objects.XBoolean, .XNumber, .XObject, jdk.xml.internal.JdkXmlUtils, org.w3c.dom.Document, .DocumentFragment, .Node, .NodeList, .Text, org.w3c.dom.traversal.NodeIterator, org.xml.sax.SAXNotSupportedException

This class contains many of the Xalan-supplied extensions. It is accessed by specifying a namespace URI as follows:
   xmlns:xalan="http://xml.apache.org/xalan"

Constructor Summary

AccessConstructor and Description
private
Extensions()

Constructor Extensions

Method Summary

Modifier and TypeMethod and Description
public static NodeList

Returns:

a NodeList containing the nodes in nl1 that are not in nl2 Note: The usage of this extension function in the xalan namespace is deprecated. Please use the same function in the EXSLT sets extension (http://exslt.org/sets).
difference
(NodeList
NodeList for first node-set
nl1
,
NodeList
NodeList for second node-set
nl2
)

Returns the difference between two node-sets.

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.

Note

The usage of this extension function in the xalan namespace is deprecated. Please use the same function in the EXSLT sets extension (http://exslt.org/sets).

distinct
(NodeList
NodeList for node-set
nl
)

Returns node-set containing distinct string values.

public static XObject

Returns:

the XObject resulting from evaluating the XPath
evaluate
(ExpressionContext
an ExpressionContext passed in by the extension mechanism. This must be an XPathContext.
myContext
,
String
The XPath expression to be evaluated.
xpathExpr
)

Returns the result of evaluating the argument as a string containing an XPath expression.

public static boolean

Returns:

true if nl1 and nl2 contain exactly the same set of nodes.
hasSameNodes
(NodeList
NodeList for first node-set
nl1
,
NodeList
NodeList for second node-set
nl2
)

Returns true if both node-sets contain the same set of nodes.

public static NodeList

Returns:

a NodeList containing the nodes in nl1 that are also in nl2 Note: The usage of this extension function in the xalan namespace is deprecated. Please use the same function in the EXSLT sets extension (http://exslt.org/sets).
intersection
(NodeList
NodeList for first node-set
nl1
,
NodeList
NodeList for second node-set
nl2
)

Returns the intersection of two node-sets.

public static NodeSet
nodeset(ExpressionContext
Context passed by the extension processor
myProcessor
,
Object
Argument in the stylesheet to the nodeset extension function NEEDSDOC ($objectName$) @return
rtf
)

This method is an extension that implements as a Xalan extension the node-set function also found in xt and saxon.

public static NodeList

Returns:

a NodeSet as described above.
tokenize
(String
The string to be split into text tokens.
toTokenize
,
String
The delimiters to use.
delims
)

Returns a NodeSet containing one text node for each token in the first argument.

public static NodeList

Returns:

a NodeSet as described above.
tokenize
(String
The string to be split into text tokens.
toTokenize
)

Returns a NodeSet containing one text node for each token in the first argument.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Extensionsback to summary
private Extensions()

Constructor Extensions

Method Detail

differenceback to summary
public static NodeList difference(NodeList nl1, NodeList nl2)

Returns the difference between two node-sets.

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 Note: The usage of this extension function in the xalan namespace is deprecated. Please use the same function in the EXSLT sets extension (http://exslt.org/sets).

distinctback to summary
public static NodeList distinct(NodeList nl)

Returns node-set containing distinct string values.

Parameters
nl:NodeList

NodeList for 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.

Note

The usage of this extension function in the xalan namespace is deprecated. Please use the same function in the EXSLT sets extension (http://exslt.org/sets).

evaluateback to summary
public static XObject evaluate(ExpressionContext myContext, String xpathExpr) throws SAXNotSupportedException

Returns the result of evaluating the argument as a string containing an XPath expression. Used where the XPath expression is not known until run-time. The expression is evaluated as if the run-time value of the argument appeared in place of the evaluate function call at compile time.

Parameters
myContext:ExpressionContext

an ExpressionContext passed in by the extension mechanism. This must be an XPathContext.

xpathExpr:String

The XPath expression to be evaluated.

Returns:XObject

the XObject resulting from evaluating the XPath

Exceptions
SAXNotSupportedException:
Note: The usage of this extension function in the xalan namespace is deprecated. Please use the same function in the EXSLT dynamic extension (http://exslt.org/dynamic).
hasSameNodesback to summary
public static boolean hasSameNodes(NodeList nl1, NodeList nl2)

Returns true if both node-sets contain the same set of nodes.

Parameters
nl1:NodeList

NodeList for first node-set

nl2:NodeList

NodeList for second node-set

Returns:boolean

true if nl1 and nl2 contain exactly the same set of nodes.

intersectionback to summary
public static NodeList intersection(NodeList nl1, NodeList nl2)

Returns the intersection of two node-sets.

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 Note: The usage of this extension function in the xalan namespace is deprecated. Please use the same function in the EXSLT sets extension (http://exslt.org/sets).

nodesetback to summary
public static NodeSet nodeset(ExpressionContext myProcessor, Object rtf)

This method is an extension that implements as a Xalan extension the node-set function also found in xt and saxon. If the argument is a Result Tree Fragment, then nodeset returns a node-set consisting of a single root node as described in section 11.1 of the XSLT 1.0 Recommendation. If the argument is a node-set, nodeset returns a node-set. If the argument is a string, number, or boolean, then nodeset returns a node-set consisting of a single root node with a single text node child that is the result of calling the XPath string() function on the passed parameter. If the argument is anything else, then a node-set is returned consisting of a single root node with a single text node child that is the result of calling the java toString() method on the passed argument. Most of the actual work here is done in MethodResolver and XRTreeFrag.

Parameters
myProcessor:ExpressionContext

Context passed by the extension processor

rtf:Object

Argument in the stylesheet to the nodeset extension function NEEDSDOC ($objectName$) @return

tokenizeback to summary
public static NodeList tokenize(String toTokenize, String delims)

Returns a NodeSet containing one text node for each token in the first argument. Delimiters are specified in the second argument. Tokens are determined by a call to StringTokenizer. If the first argument is an empty string or contains only delimiters, the result will be an empty NodeSet. Contributed to XalanJ1 by Benoit Cerrina.

Parameters
toTokenize:String

The string to be split into text tokens.

delims:String

The delimiters to use.

Returns:NodeList

a NodeSet as described above.

tokenizeback to summary
public static NodeList tokenize(String toTokenize)

Returns a NodeSet containing one text node for each token in the first argument. Delimiters are whitespace. That is, the delimiters that are used are tab ( ), linefeed ( ), return ( ), and space ( ). Tokens are determined by a call to StringTokenizer. If the first argument is an empty string or contains only delimiters, the result will be an empty NodeSet. Contributed to XalanJ1 by Benoit Cerrina.

Parameters
toTokenize:String

The string to be split into text tokens.

Returns:NodeList

a NodeSet as described above.