|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xalan.lib.Extensions
public class Extensions
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"
Nested Class Summary | |
---|---|
private static class |
Extensions.DocumentHolder
This class is not loaded until first referenced (see Java Language Specification by Gosling/Joy/Steele, section 12.4.1) The static members are created when this class is first referenced, as a lazy initialization not needing checking against null or any synchronization. |
Constructor Summary | |
---|---|
private |
Extensions()
Constructor Extensions |
Method Summary | |
---|---|
static org.w3c.dom.Node |
checkEnvironment(ExpressionContext myContext)
Return a Node of basic debugging information from the EnvironmentCheck utility about the Java environment. |
private static org.w3c.dom.Node |
checkEnvironmentUsingWhich(ExpressionContext myContext,
org.w3c.dom.Document factoryDocument)
Private worker method to attempt to use org.apache.env.Which. |
static org.w3c.dom.NodeList |
difference(org.w3c.dom.NodeList nl1,
org.w3c.dom.NodeList nl2)
Returns the difference between two node-sets. |
static org.w3c.dom.NodeList |
distinct(org.w3c.dom.NodeList nl)
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(org.w3c.dom.NodeList nl1,
org.w3c.dom.NodeList nl2)
Returns true if both node-sets contain the same set of nodes. |
static org.w3c.dom.NodeList |
intersection(org.w3c.dom.NodeList nl1,
org.w3c.dom.NodeList nl2)
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. |
static org.w3c.dom.NodeList |
tokenize(java.lang.String toTokenize)
Returns a NodeSet containing one text node for each token in the first argument. |
static org.w3c.dom.NodeList |
tokenize(java.lang.String toTokenize,
java.lang.String delims)
Returns a NodeSet containing one text node for each token in the first argument. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private Extensions()
Method Detail |
---|
public static NodeSet nodeset(ExpressionContext myProcessor, java.lang.Object rtf)
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
.
myProcessor
- Context passed by the extension processorrtf
- Argument in the stylesheet to the nodeset extension function
NEEDSDOC ($objectName$) @returnpublic static org.w3c.dom.NodeList intersection(org.w3c.dom.NodeList nl1, org.w3c.dom.NodeList nl2)
nl1
- NodeList for first node-setnl2
- NodeList for second node-set
public static org.w3c.dom.NodeList difference(org.w3c.dom.NodeList nl1, org.w3c.dom.NodeList nl2)
nl1
- NodeList for first node-setnl2
- NodeList for second node-set
public static org.w3c.dom.NodeList distinct(org.w3c.dom.NodeList nl)
nl
- NodeList for node-set
public static boolean hasSameNodes(org.w3c.dom.NodeList nl1, org.w3c.dom.NodeList nl2)
nl1
- NodeList for first node-setnl2
- NodeList for second node-set
public static XObject evaluate(ExpressionContext myContext, java.lang.String xpathExpr) throws org.xml.sax.SAXNotSupportedException
myContext
- an ExpressionContext
passed in by the
extension mechanism. This must be an XPathContext.xpathExpr
- The XPath expression to be evaluated.
org.xml.sax.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).public static org.w3c.dom.NodeList tokenize(java.lang.String toTokenize, java.lang.String delims)
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.
toTokenize
- The string to be split into text tokens.delims
- The delimiters to use.
public static org.w3c.dom.NodeList tokenize(java.lang.String toTokenize)
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.
toTokenize
- The string to be split into text tokens.
public static org.w3c.dom.Node checkEnvironment(ExpressionContext myContext)
Simply calls the EnvironmentCheck
utility to grab info about the Java environment and CLASSPATH,
etc., and then returns the resulting Node. Stylesheets can
then maniuplate this data or simply xsl:copy-of the Node. Note
that we first attempt to load the more advanced
org.apache.env.Which utility by reflection; only if that fails
to we still use the internal version. Which is available from
http://xml.apache.org/commons/.
We throw a WrappedRuntimeException in the unlikely case that reading information from the environment throws us an exception. (Is this really the best thing to do?)
myContext
- an ExpressionContext
passed in by the
extension mechanism. This must be an XPathContext.
private static org.w3c.dom.Node checkEnvironmentUsingWhich(ExpressionContext myContext, org.w3c.dom.Document factoryDocument)
myContext
- an ExpressionContext
passed in by the
extension mechanism. This must be an XPathContext.factoryDocument
- providing createElement services, etc.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |