## com.saxonica.schema.sdoc
Class SelectionParser

    java.lang.Object
      net.sf.saxon.expr.ExpressionParser
          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 <unique>, <key>, and <keyref> elements.

Nested Class Summary

Nested classes/interfaces inherited from class net.sf.saxon.expr.ExpressionParser
`ExpressionParser.FLWORClause, ExpressionParser.ForClause, ExpressionParser.TemporaryContainer`

Field Summary

Fields inherited from class net.sf.saxon.expr.ExpressionParser
`allowXPath30Syntax, compileWithTracing, 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()` Parse a UnionExpr: IntersectExceptExpr ( "|" | "union" IntersectExceptExpr )*

Methods inherited from class net.sf.saxon.expr.ExpressionParser

`atStartOfRelativePath, currentTokenDisplay, declareRangeVariable, disallowedAtStartOfRelativePath, expect, findRangeVariable, getDefaultContainer, getLanguage, getNameChecker, getRangeVariables, getStaticContext, getTokenizer, grumble, grumble, grumble, grumble, isCompileWithTracing, isKeyword, isNamespaceTestAllowed, makeCurriedFunction, makeLocalNameTest, makeNameCode, makeNameCodeSilently, makeNamespaceTest, makeNameTest, makeStringLiteral, makeStructuredQName, makeTracer, nextToken, normalizeEQName, parse, parseBasicStep, parseConstructor, parseDynamicFunctionCall, parseExpression, parseExprSingle, parseExtensionExpression, parseForExpression, parseFunctionArgument, parseFunctionCall, parseFunctionItemType, parseInlineFunction, parseItemType, parseLiteralFunctionItem, parseNodeTest, parseNumericLiteral, parseParenthesizedItemType, parsePathExpression, parsePredicate, parseRemainingPath, parseSequenceType, parseSequenceType, parseStepExpression, parseStringLiteral, parseSwitchExpression, parseTryCatchExpression, parseTypeswitchExpression, parseValidateExpression, parseVariableReference, resolveFunctionName, setCompileWithTracing, 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

  Description copied from class: `ExpressionParser`
  Parse a UnionExpr:
  IntersectExceptExpr ( "|" | "union" IntersectExceptExpr )*

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

### 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`

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