com.jclark.xsl.expr

Class ExprParser

public class ExprParser extends ExprTokenizer implements NamespaceConstants

XPAth expression parser / compiler extends the lexer ExprTokenizer
Method Summary
static booleanfunctionAvailable(Name name, ExprContext context)
static NodeSetExprgetChildrenExpr()
ConvertibleExprmakeRelationalExpr(Relation rel, ConvertibleExpr e1, ConvertibleExpr e2)
A ConvertibleExpr allows for the casting of one type to another for the purpose of making a comparison
static BooleanExprparseBooleanExpr(Node node, String expr, VariableSet locals)
parse an XPath expression which is to be used in a context in which a Boolean is expected
static NodeSetExprparseNodeSetExpr(Node node, String expr, VariableSet locals)
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"
static NumberExprparseNumberExpr(Node node, String expr, VariableSet locals)
parse an XPath expression which is to be used in a context in which a Number is expected
static TopLevelPatternparsePattern(Node node, String pattern)
parse an XPath match Pattern
static TopLevelPatternparsePattern(Node node, String pattern, VariableSet locals)
parse an XPath match pattern (with some variables!
static StringExprparseStringExpr(Node node, String expr, VariableSet locals)
parse an XPath expression which is to be used in a context in which a String is expected
static StringExprparseValueExpr(Node node, String value, VariableSet locals)
parse an XSLT attribute value template (which may include XPath expression(s) enclosed in curlybraces "{" "}")
static VariantExprparseVariantExpr(Node node, 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

Method Detail

functionAvailable

static boolean functionAvailable(Name name, ExprContext context)

getChildrenExpr

public static NodeSetExpr getChildrenExpr()

makeRelationalExpr

ConvertibleExpr makeRelationalExpr(Relation rel, ConvertibleExpr e1, ConvertibleExpr e2)
A ConvertibleExpr allows for the casting of one type to another for the purpose of making a comparison

parseBooleanExpr

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

parseNodeSetExpr

public static NodeSetExpr parseNodeSetExpr(Node node, String expr, VariableSet locals)
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"

parseNumberExpr

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

parsePattern

public static TopLevelPattern parsePattern(Node node, String pattern)
parse an XPath match Pattern

parsePattern

public static TopLevelPattern parsePattern(Node node, String pattern, VariableSet locals)
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

parseStringExpr

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

parseValueExpr

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

parseVariantExpr

public static VariantExpr parseVariantExpr(Node node, 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