com.saxonica.schema.sdoc
Class SelectionParser

java.lang.Object
  extended by net.sf.saxon.expr.parser.ExpressionParser
      extended by com.saxonica.schema.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.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.saxon.expr.parser.ExpressionParser
ExpressionParser.TemporaryContainer
 
Field Summary
 
Fields inherited from class net.sf.saxon.expr.parser.ExpressionParser
allowXPath30Syntax, defaultContainer, env, language, languageVersion, nameChecker, rangeVariables, scanOnly, SEQUENCE_TYPE, t, XPATH, XQUERY, XSLT_PATTERN
 
Constructor Summary
SelectionParser()
           
 
Method Summary
protected  Expression parseRelativePath()
          Parse a relative path (a sequence of steps).
 Pattern parseSelector(String expression, StaticContext env, boolean isField)
          Parse a string representing the restricted XPath expression allowed in an XML Schema selector or field attribute
protected  Expression parseStepExpression()
          Override the general XPath parsing of a StepExpression to support the simpler kind of Step used in XML Schema selectors
protected  Expression parseUnionExpression()
           
 
Methods inherited from class net.sf.saxon.expr.parser.ExpressionParser
atStartOfRelativePath, currentTokenDisplay, customizeTokenizer, declareRangeVariable, disallowedAtStartOfRelativePath, expect, findRangeVariable, getCodeInjector, getDefaultContainer, getLanguage, getNameChecker, getRangeVariables, getStaticContext, getTokenizer, grumble, grumble, grumble, grumble, grumble, isKeyword, isNamespaceTestAllowed, makeCurriedFunction, makeLocalNameTest, makeNameCode, makeNameCodeSilently, makeNamespaceTest, makeNameTest, makeNodeName, makeStringLiteral, makeStructuredQName, makeTracer, nextToken, normalizeEQName, parse, parseBasicStep, parseBinaryExpression, parseConstructor, parseDynamicFunctionCall, parseExpression, parseExprSingle, parseExtensionExpression, parseFLWORExpression, parseFunctionArgument, parseFunctionCall, parseFunctionItemType, parseInlineFunction, parseItemType, parseLiteralFunctionItem, parseMapExpression, parseMapItemType, parseNodeTest, parseNumericLiteral, parseParenthesizedItemType, parsePathExpression, parsePredicate, parseRemainingPath, parseSequenceType, parseSequenceType, parseStepExpression, parseStringLiteral, parseSwitchExpression, parseTryCatchExpression, parseTypePattern, parseTypeswitchExpression, parseValidateExpression, parseVariableReference, reportMissingFunction, resolveFunctionName, setCodeInjector, setDefaultContainer, setLanguage, setLocation, setLocation, setRangeVariables, setRangeVariableStack, setScanOnly, undeclareRangeVariable, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionParser

public SelectionParser()
Method Detail

parseSelector

public Pattern 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 String
env - the static context for the expression
isField - 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

parseUnionExpression

protected Expression parseUnionExpression()
                                   throws XPathException
Throws:
XPathException

parseRelativePath

protected Expression parseRelativePath()
                                throws XPathException
Description copied from class: ExpressionParser
Parse a relative path (a sequence of steps). Called when the current token immediately follows a separator (/ or //), or an implicit separator (XYZ is equivalent to ./XYZ)

Overrides:
parseRelativePath in class ExpressionParser
Returns:
the resulting subexpression
Throws:
XPathException - if any error is encountered

parseStepExpression

protected Expression parseStepExpression()
                                  throws XPathException
Override the general XPath parsing of a StepExpression to support the simpler kind of Step used in XML Schema selectors

Returns:
an Expression, which will always be either an AxisExpression or a ContextItemExpression
Throws:
XPathException - if parsing fails


Copyright (c) 2004-2011 Saxonica Limited. All rights reserved.