286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 1999-2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * This class contains many of the Xalan-supplied extensions. 286N/A * It is accessed by specifying a namespace URI as follows: 286N/A * Constructor Extensions 286N/A * This method is an extension that implements as a Xalan extension 286N/A * the node-set function also found in xt and saxon. 286N/A * If the argument is a Result Tree Fragment, then <code>nodeset</code> 286N/A * returns a node-set consisting of a single root node as described in 286N/A * section 11.1 of the XSLT 1.0 Recommendation. If the argument is a 286N/A * node-set, <code>nodeset</code> returns a node-set. If the argument 286N/A * is a string, number, or boolean, then <code>nodeset</code> returns 286N/A * a node-set consisting of a single root node with a single text node 286N/A * child that is the result of calling the XPath string() function on the 286N/A * passed parameter. If the argument is anything else, then a node-set 286N/A * is returned consisting of a single root node with a single text node 286N/A * child that is the result of calling the java <code>toString()</code> 286N/A * method on the passed argument. 286N/A * actual work here is done in <code>MethodResolver</code> and 286N/A * <code>XRTreeFrag</code>. 286N/A * @param myProcessor Context passed by the extension processor 286N/A * @param rtf Argument in the stylesheet to the nodeset extension function 286N/A * NEEDSDOC ($objectName$) @return 286N/A // This no longer will work right since the DTM. 286N/A // Document myDoc = myProcessor.getContextNode().getOwnerDocument(); 286N/A * Returns the intersection of two node-sets. 286N/A * @param nl1 NodeList for first node-set 286N/A * @param nl2 NodeList for second node-set 286N/A * @return a NodeList containing the nodes in nl1 that are also in nl2 286N/A * Note: The usage of this extension function in the xalan namespace 286N/A * is deprecated. Please use the same function in the EXSLT sets extension 286N/A * Returns the difference between two node-sets. 286N/A * @param nl1 NodeList for first node-set 286N/A * @param nl2 NodeList for second node-set 286N/A * @return a NodeList containing the nodes in nl1 that are not in nl2 286N/A * Note: The usage of this extension function in the xalan namespace 286N/A * is deprecated. Please use the same function in the EXSLT sets extension 286N/A * Returns node-set containing distinct string values. 286N/A * @param nl NodeList for node-set 286N/A * @return a NodeList with nodes from nl containing distinct string values. 286N/A * In other words, if more than one node in nl contains the same string value, 286N/A * only include the first such node found. 286N/A * Note: The usage of this extension function in the xalan namespace 286N/A * is deprecated. Please use the same function in the EXSLT sets extension 286N/A * Returns true if both node-sets contain the same set of nodes. 286N/A * @param nl1 NodeList for first node-set 286N/A * @param nl2 NodeList for second node-set 286N/A * @return true if nl1 and nl2 contain exactly the same set of nodes. 286N/A * Returns the result of evaluating the argument as a string containing 286N/A * an XPath expression. Used where the XPath expression is not known until 286N/A * run-time. The expression is evaluated as if the run-time value of the 286N/A * argument appeared in place of the evaluate function call at compile time. 286N/A * @param myContext an <code>ExpressionContext</code> passed in by the 286N/A * extension mechanism. This must be an XPathContext. 286N/A * @param xpathExpr The XPath expression to be evaluated. 286N/A * @return the XObject resulting from evaluating the XPath 286N/A * @throws SAXNotSupportedException 286N/A * Note: The usage of this extension function in the xalan namespace 286N/A * is deprecated. Please use the same function in the EXSLT dynamic extension 286N/A * Returns a NodeSet containing one text node for each token in the first argument. 286N/A * Delimiters are specified in the second argument. 286N/A * Tokens are determined by a call to <code>StringTokenizer</code>. 286N/A * If the first argument is an empty string or contains only delimiters, the result 286N/A * will be an empty NodeSet. 286N/A * Contributed to XalanJ1 by <a href="mailto:benoit.cerrina@writeme.com">Benoit Cerrina</a>. 286N/A * @param toTokenize The string to be split into text tokens. 286N/A * @param delims The delimiters to use. 286N/A * @return a NodeSet as described above. 286N/A * Returns a NodeSet containing one text node for each token in the first argument. 286N/A * Delimiters are whitespace. That is, the delimiters that are used are tab (	), 286N/A * linefeed (
), return (
), and space ( ). 286N/A * Tokens are determined by a call to <code>StringTokenizer</code>. 286N/A * If the first argument is an empty string or contains only delimiters, the result 286N/A * will be an empty NodeSet. 286N/A * Contributed to XalanJ1 by <a href="mailto:benoit.cerrina@writeme.com">Benoit Cerrina</a>. 286N/A * @param toTokenize The string to be split into text tokens. 286N/A * @return a NodeSet as described above. 286N/A * Return a Node of basic debugging information from the 286N/A * EnvironmentCheck utility about the Java environment. 286N/A * <p>Simply calls the {@link com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck} 286N/A * utility to grab info about the Java environment and CLASSPATH, 286N/A * etc., and then returns the resulting Node. Stylesheets can 286N/A * then maniuplate this data or simply xsl:copy-of the Node. Note 286N/A * that we first attempt to load the more advanced 286N/A * org.apache.env.Which utility by reflection; only if that fails 286N/A * to we still use the internal version. Which is available from 286N/A * <p>We throw a WrappedRuntimeException in the unlikely case 286N/A * that reading information from the environment throws us an 286N/A * exception. (Is this really the best thing to do?)</p> 286N/A * @param myContext an <code>ExpressionContext</code> passed in by the 286N/A * extension mechanism. This must be an XPathContext. 286N/A * @return a Node as described above. 286N/A // First use reflection to try to load Which, which is a 286N/A // better version of EnvironmentCheck 286N/A // If reflection failed, fallback to our internal EnvironmentCheck 286N/A * Private worker method to attempt to use org.apache.env.Which. 286N/A * @param myContext an <code>ExpressionContext</code> passed in by the 286N/A * extension mechanism. This must be an XPathContext. 286N/A * @param factoryDocument providing createElement services, etc. 286N/A * @return a Node with environment info; null if any error 286N/A // Use reflection to try to find xml-commons utility 'Which' 286N/A // Fully qualify names since this is the only method they're used in 286N/A // Call the method with our Hashtable, common options, and ignore return value 286N/A // Create a parent to hold the report and append hash to it 286N/A // Simply return null; no need to report error 286N/A * This class is not loaded until first referenced (see Java Language 286N/A * The static members are created when this class is first referenced, as a 286N/A * lazy initialization not needing checking against null or any 286N/A // Reuse the Document object to reduce memory usage.