com.jclark.xsl.expr
Class ExprParser

java.lang.Object
  |
  +--com.jclark.xsl.expr.ExprTokenizer
        |
        +--com.jclark.xsl.expr.ExprParser
All Implemented Interfaces:
NamespaceConstants

public class ExprParser
extends com.jclark.xsl.expr.ExprTokenizer
implements NamespaceConstants

XPAth expression parser / compiler extends the lexer ExprTokenizer


Fields inherited from interface com.jclark.xsl.om.NamespaceConstants
XFYXT_NAMESPACE, XT_NAMESPACE
 
Method Summary
static NodeSetExpr getChildrenExpr()
           
static BooleanExpr parseBooleanExpr(Node node, java.lang.String expr, VariableSet locals)
          parse an XPath expression which is to be used in a context in which a Boolean is expected
static NodeSetExpr parseNodeSetExpr(Node node, java.lang.String expr, VariableSet locals)
          parse an XPath expression which is to be used in a context in which a NodeSet is expected i.e.
static NumberExpr parseNumberExpr(Node node, java.lang.String expr, VariableSet locals)
          parse an XPath expression which is to be used in a context in which a Number is expected
static TopLevelPattern parsePattern(Node node, java.lang.String pattern)
          parse an XPath match Pattern
static TopLevelPattern parsePattern(Node node, java.lang.String pattern, VariableSet locals)
          parse an XPath match pattern (with some variables!?!?)
static StringExpr parseStringExpr(Node node, java.lang.String expr, VariableSet locals)
          parse an XPath expression which is to be used in a context in which a String is expected
static StringExpr parseValueExpr(Node node, java.lang.String value, VariableSet locals)
          parse an XSLT attribute value template (which may include XPath expression(s) enclosed in curlybraces "{" "}")
static VariantExpr parseVariantExpr(Node node, java.lang.String expr, VariableSet locals)
          parse an XPath expression which is to be used in a context in which a Variant (xsl:variable, xsl:param) is expected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseValueExpr

public static StringExpr parseValueExpr(Node node,
                                        java.lang.String value,
                                        VariableSet locals)
                                 throws XSLException
parse an XSLT attribute value template (which may include XPath expression(s) enclosed in curlybraces "{" "}")

getChildrenExpr

public static NodeSetExpr getChildrenExpr()

parsePattern

public static TopLevelPattern parsePattern(Node node,
                                           java.lang.String pattern)
                                    throws XSLException
parse an XPath match Pattern

parsePattern

public static TopLevelPattern parsePattern(Node node,
                                           java.lang.String pattern,
                                           VariableSet locals)
                                    throws XSLException
parse an XPath match pattern (with some variables!?!?)
Parameters:
node - represents the node in the stylesheet with the expression we're parsing. Used for plugging the location in any Exception we might throw xsl:number allows variables in the "count" and "from" attributes

parseNodeSetExpr

public static NodeSetExpr parseNodeSetExpr(Node node,
                                           java.lang.String expr,
                                           VariableSet locals)
                                    throws XSLException
parse an XPath expression which is to be used in a context in which a NodeSet is expected i.e. for the "select" attribute of an "xsl:apply-templates"

parseStringExpr

public static StringExpr parseStringExpr(Node node,
                                         java.lang.String expr,
                                         VariableSet locals)
                                  throws XSLException
parse an XPath expression which is to be used in a context in which a String is expected

parseNumberExpr

public static NumberExpr parseNumberExpr(Node node,
                                         java.lang.String expr,
                                         VariableSet locals)
                                  throws XSLException
parse an XPath expression which is to be used in a context in which a Number is expected

parseBooleanExpr

public static BooleanExpr parseBooleanExpr(Node node,
                                           java.lang.String expr,
                                           VariableSet locals)
                                    throws XSLException
parse an XPath expression which is to be used in a context in which a Boolean is expected

parseVariantExpr

public static VariantExpr parseVariantExpr(Node node,
                                           java.lang.String expr,
                                           VariableSet locals)
                                    throws XSLException
parse an XPath expression which is to be used in a context in which a Variant (xsl:variable, xsl:param) is expected