com.saxonica.sdoc
Class SelectionParser
java.lang.Object
net.sf.saxon.expr.ExpressionParser
com.saxonica.sdoc.SelectionParser
public class SelectionParser
- extends ExpressionParser
This class parses the two XPath subsets defined in XML Schema for handling
the "selector" and "field" attributes of the , , and
elements.
Methods inherited from class net.sf.saxon.expr.ExpressionParser |
getRangeVariableStack, getTokenizer, isCompileWithTracing, makeLocalNameTest, makeNameCode, makeNameCodeSilently, makeNamespaceTest, makeNameTest, makeStructuredQName, parse, parsePattern, parseSequenceType, setCompileWithTracing, setRangeVariableStack, setScanOnly |
SelectionParser
public SelectionParser()
parseSelector
public Selection parseSelector(String expression,
StaticContext env,
boolean isField)
throws XPathException
- Parse a string representing the restricted XPath expression allowed
in an XML Schema selector or field attribute
- Parameters:
expression
- the expression expressed as a Stringenv
- the static context for the expressionisField
- true if the attribute is a "field" attribute, false if
it is a "selector" attribute
- Returns:
- an Expression object representing the result of parsing
- Throws:
XPathException
- if the expression contains a syntax error
makePathSelection
public static PathSelection makePathSelection(Expression path,
boolean failIfInvalid)
throws XPathException
- Make a PathSelection object from a suitable expression. This method is public because it is also
used by the optimizer for SequentialCopy expressions.
- Parameters:
path
- the input expressionfailIfInvalid
- if true, the method will throw an exception if the expression is unsuitable.
If false, it will return null if the expression is unsuitable.
- Returns:
- The PathSelection object, or null if the expression is unsuitable for use as a PathSelection
and the failIfInvalid argument was set to false.
- Throws:
XPathException
- if the expression is unsuitable for use as a PathSelection
and the failIfInvalid argument was set to true.
Copyright (C) Michael H. Kay. All rights reserved.