Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weblogic.apache.xalan.lib
Class Extensions

    java.lang.Object
      |
      +--weblogic.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"

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

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.
`static NodeSet` | `difference(org.w3c.dom.traversal.NodeIterator ni1, org.w3c.dom.traversal.NodeIterator ni2)` Returns the difference between two node-sets.
`static NodeSet` | `distinct(ExpressionContext myContext, org.w3c.dom.traversal.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(org.w3c.dom.traversal.NodeIterator ni1, org.w3c.dom.traversal.NodeIterator ni2)` Returns true of both node-sets contain the same set of nodes.
`static NodeSet` | `intersection(org.w3c.dom.traversal.NodeIterator ni1, org.w3c.dom.traversal.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.
`static NodeSet` | `tokenize(ExpressionContext myContext, java.lang.String toTokenize)` Returns a NodeSet containing one text node for each token in the first argument.
`static NodeSet` | `tokenize(ExpressionContext myContext, 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`

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. 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` - Context passed by the extension processor
    `rtf` - Argument in the stylesheet to the nodeset extension function NEEDSDOC ($objectName$) @return

### intersection

    public static NodeSet intersection(org.w3c.dom.traversal.NodeIterator ni1,
                                       org.w3c.dom.traversal.NodeIterator ni2)
                                throws javax.xml.transform.TransformerException

  Returns the intersection of two node-sets.

  Parameters:
    `n1` - NodeIterator for first node-set NEEDSDOC @param ni1
    `ni2` - NodeIterator for second node-set
  Returns:
    a NodeSet containing the nodes in ni1 that are also in ni2
  Throws:
    javax.xml.transform.TransformerException -

### difference

    public static NodeSet difference(org.w3c.dom.traversal.NodeIterator ni1,
                                     org.w3c.dom.traversal.NodeIterator ni2)
                              throws javax.xml.transform.TransformerException

  Returns the difference between two node-sets.

  Parameters:
    `n1` - NodeIterator for first node-set NEEDSDOC @param ni1
    `ni2` - NodeIterator for second node-set
  Returns:
    a NodeSet containing the nodes in ni1 that are not in ni2
  Throws:
    javax.xml.transform.TransformerException -

### distinct

    public static NodeSet distinct(ExpressionContext myContext,
                                   org.w3c.dom.traversal.NodeIterator ni)
                            throws javax.xml.transform.TransformerException

  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.
  Throws:
    javax.xml.transform.TransformerException -

### hasSameNodes

    public static boolean hasSameNodes(org.w3c.dom.traversal.NodeIterator ni1,
                                       org.w3c.dom.traversal.NodeIterator ni2)

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

  Parameters:
    `n1` - NodeIterator for first node-set NEEDSDOC @param ni1
    `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 org.xml.sax.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. NEEDSDOC @param xpathExpr
  Returns:
    the XObject resulting from evaluating the XPath
  Throws:
    java.lang.Exception -
    org.xml.sax.SAXNotSupportedException -

### tokenize

    public static NodeSet tokenize(ExpressionContext myContext,
                                   java.lang.String toTokenize,
                                   java.lang.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:
    `myContext` - an `ExpressionContext` passed in by the extension mechanism. This must be an XPathContext.
    `toTokenize` - The string to be split into text tokens.
    `delims` - The delimiters to use.
  Returns:
    a NodeSet as described above.

### tokenize

    public static NodeSet tokenize(ExpressionContext myContext,
                                   java.lang.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:
    `myContext` - an `ExpressionContext` passed in by the extension mechanism. This must be an XPathContext.
    `toTokenize` - The string to be split into text tokens.
  Returns:
    a NodeSet as described above.

### checkEnvironment

    public static org.w3c.dom.Node checkEnvironment(ExpressionContext myContext)

  Return a Node of basic debugging information from the EnvironmentCheck utility about the Java environment.

  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.

  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?)

  Parameters:
    `myContext` - an `ExpressionContext` passed in by the extension mechanism. This must be an XPathContext.
  Returns:
    a Node as described above.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://e-docs.bea.com/wls/docs70
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved.
WebLogic Server 7.0 API Reference