286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 1999-2004 The Apache Software Foundation.
286N/A *
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 *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
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 */
286N/A/*
286N/A * $Id: ExpressionContext.java,v 1.2.4.1 2005/09/10 19:34:03 jeffsuttor Exp $
286N/A */
286N/Apackage com.sun.org.apache.xalan.internal.extensions;
286N/A
286N/Aimport javax.xml.transform.ErrorListener;
286N/A
286N/Aimport com.sun.org.apache.xpath.internal.objects.XObject;
286N/Aimport org.w3c.dom.Node;
286N/Aimport org.w3c.dom.traversal.NodeIterator;
286N/A
286N/A/**
286N/A * An object that implements this interface can supply
286N/A * information about the current XPath expression context.
286N/A */
286N/Apublic interface ExpressionContext
286N/A{
286N/A
286N/A /**
286N/A * Get the current context node.
286N/A * @return The current context node.
286N/A */
286N/A public Node getContextNode();
286N/A
286N/A /**
286N/A * Get the current context node list.
286N/A * @return An iterator for the current context list, as
286N/A * defined in XSLT.
286N/A */
286N/A public NodeIterator getContextNodes();
286N/A
286N/A /**
286N/A * Get the error listener.
286N/A * @return The registered error listener.
286N/A */
286N/A public ErrorListener getErrorListener();
286N/A
286N/A /**
286N/A * Get the value of a node as a number.
286N/A * @param n Node to be converted to a number. May be null.
286N/A * @return value of n as a number.
286N/A */
286N/A public double toNumber(Node n);
286N/A
286N/A /**
286N/A * Get the value of a node as a string.
286N/A * @param n Node to be converted to a string. May be null.
286N/A * @return value of n as a string, or an empty string if n is null.
286N/A */
286N/A public String toString(Node n);
286N/A
286N/A /**
286N/A * Get a variable based on it's qualified name.
286N/A *
286N/A * @param qname The qualified name of the variable.
286N/A *
286N/A * @return The evaluated value of the variable.
286N/A *
286N/A * @throws javax.xml.transform.TransformerException
286N/A */
286N/A public XObject getVariableOrParam(com.sun.org.apache.xml.internal.utils.QName qname)
286N/A throws javax.xml.transform.TransformerException;
286N/A
286N/A /**
286N/A * Get the XPathContext that owns this ExpressionContext.
286N/A *
286N/A * Note: exslt:function requires the XPathContext to access
286N/A * the variable stack and TransformerImpl.
286N/A *
286N/A * @return The current XPathContext.
286N/A * @throws javax.xml.transform.TransformerException
286N/A */
286N/A public com.sun.org.apache.xpath.internal.XPathContext getXPathContext()
286N/A throws javax.xml.transform.TransformerException;
286N/A
286N/A}