org.apache.xalan.lib
Class Extensions

java.lang.Object
  |
  +--org.apache.xalan.lib.Extensions

public class Extensions
extends java.lang.Object

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"
 


Method Summary
static NodeSet difference(NodeIterator ni1, NodeIterator ni2)
          Returns the difference between two node-sets.
static NodeSet distinct(NodeIterator ni)
          Returns node-set containing distinct string values.
static XObject evaluate(ExpressionContext myContext, java.lang.String xpathExpr)
          Returns the result of evaluating the argument as a string containing an XPath expression.
static boolean hasSameNodes(NodeIterator ni1, NodeIterator ni2)
          Returns true of both node-sets contain the same set of nodes.
static NodeSet intersection(NodeIterator ni1, NodeIterator ni2)
          Returns the intersection of two node-sets.
static NodeSet nodeset(ExpressionContext myProcessor, java.lang.Object rtf)
          This method is an extension that implements as a Xalan extension the node-set function also found in xt and saxon.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

nodeset

public static NodeSet nodeset(ExpressionContext myProcessor,
                              java.lang.Object rtf)
This method is an extension that implements as a Xalan extension the node-set function also found in xt and saxon. As described in section 11.1 of XSLT 1.0 Recommendation, the node-set returned contains just a single root node. Most of the actual work here is done in MethodResolver and XRTreeFrag.

intersection

public static NodeSet intersection(NodeIterator ni1,
                                   NodeIterator ni2)
                            throws SAXException
Returns the intersection of two node-sets.
Parameters:
n1 - NodeIterator for first node-set
ni2 - NodeIterator for second node-set
Returns:
a NodeSet containing the nodes in ni1 that are also in ni2

difference

public static NodeSet difference(NodeIterator ni1,
                                 NodeIterator ni2)
                          throws SAXException
Returns the difference between two node-sets.
Parameters:
n1 - NodeIterator for first node-set
ni2 - NodeIterator for second node-set
Returns:
a NodeSet containing the nodes in ni1 that are not in ni2

distinct

public static NodeSet distinct(NodeIterator ni)
                        throws SAXException
Returns node-set containing distinct string values.
Parameters:
ni - NodeIterator for node-set
Returns:
a NodeSet with nodes from ni containing distinct string values. In other words, if more than one node in ni contains the same string value, only include the first such node found.

hasSameNodes

public static boolean hasSameNodes(NodeIterator ni1,
                                   NodeIterator ni2)
Returns true of both node-sets contain the same set of nodes.
Parameters:
n1 - NodeIterator for first node-set
ni2 - NodeIterator for second node-set
Returns:
true if ni1 and ni2 contain exactly the same set of nodes.

evaluate

public static XObject evaluate(ExpressionContext myContext,
                               java.lang.String xpathExpr)
                        throws SAXNotSupportedException,
                               java.lang.Exception
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 - an ExpressionContext passed in by the extension mechanism. This must be an XPathContext.
xpathExtr - The XPath expression to be evaluated.
Returns:
the XObject resulting from evaluating the XPath


Copyright © 2000 Apache XML Project. All Rights Reserved.