org.apache.xalan.templates

Class FuncDocument

Implemented Interfaces:
ExpressionNode, ExpressionOwner, java.io.Serializable, SourceLocator, XPathVisitable

public class FuncDocument
extends Function2Args

Execute the Doc() function. When the document function has exactly one argument and the argument is a node-set, then the result is the union, for each node in the argument node-set, of the result of calling the document function with the first argument being the string-value of the node, and the second argument being a node-set with the node as its only member. When the document function has two arguments and the first argument is a node-set, then the result is the union, for each node in the argument node-set, of the result of calling the document function with the first argument being the string-value of the node, and with the second argument being the second argument passed to the document function.
See Also:
Serialized Form

Method Summary

void
checkNumberArgs(int argNum)
Overide the superclass method to allow one or two arguments.
void
error(XPathContext xctxt, String msg, args[] )
Tell the user of an error, and probably throw an exception.
XObject
execute(XPathContext xctxt)
Execute the function.
boolean
isNodesetExpr()
Tell if the expression is a nodeset expression.
void
warn(XPathContext xctxt, String msg, args[] )
Warn the user of a problem.

Methods inherited from class org.apache.xpath.functions.Function2Args

callArgVisitors, canTraverseOutsideSubtree, checkNumberArgs, deepEquals, fixupVariables, getArg1, setArg

Methods inherited from class org.apache.xpath.functions.FunctionOneArg

callArgVisitors, canTraverseOutsideSubtree, checkNumberArgs, deepEquals, fixupVariables, getArg0, getExpression, setArg, setExpression

Methods inherited from class org.apache.xpath.functions.Function

callArgVisitors, callVisitors, checkNumberArgs, deepEquals, execute, postCompileStep, setArg

Methods inherited from class org.apache.xpath.Expression

asIterator, asIteratorRaw, asNode, assertion, bool, canTraverseOutsideSubtree, deepEquals, error, execute, execute, execute, execute, executeCharsToContentHandler, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, fixupVariables, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isNodesetExpr, isStableNumber, num, warn, xstr

Method Details

checkNumberArgs

public void checkNumberArgs(int argNum)
            throws WrongNumberArgsException
Overide the superclass method to allow one or two arguments.
Overrides:
checkNumberArgs in interface Function2Args
Parameters:
argNum - Number of arguments passed in to this function

error

public void error(XPathContext xctxt,
                  String msg,
                  args[] )
            throws javax.xml.transform.TransformerException
Tell the user of an error, and probably throw an exception.
Parameters:
xctxt - The XPath runtime state.
msg - The error message key

execute

public XObject execute(XPathContext xctxt)
            throws javax.xml.transform.TransformerException
Execute the function. The function must return a valid object.
Overrides:
execute in interface Function
Parameters:
xctxt - The current execution context.
Returns:
A valid XObject.

isNodesetExpr

public boolean isNodesetExpr()
Tell if the expression is a nodeset expression.
Overrides:
isNodesetExpr in interface Expression
Returns:
true if the expression can be represented as a nodeset.

warn

public void warn(XPathContext xctxt,
                 String msg,
                 args[] )
            throws javax.xml.transform.TransformerException
Warn the user of a problem.
Parameters:
xctxt - The XPath runtime state.
msg - Warning message key

Copyright B) 2005 Apache XML Project. All Rights Reserved.