Package com.saxonica.ee.schema.sdoc
Class SelectionParser
java.lang.Object
net.sf.saxon.expr.parser.XPathParser
com.saxonica.ee.schema.sdoc.SelectionParser
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.parser.XPathParser
XPathParser.Accelerator, XPathParser.InlineFunctionDetails, XPathParser.NestedLocation, XPathParser.ParsedLanguage
-
Field Summary
Fields inherited from class net.sf.saxon.expr.parser.XPathParser
allowSaxonExtensions, allowXPath30Syntax, allowXPath30XSLTExtensions, allowXPath31Syntax, allowXPath40Syntax, catchDepth, charChecker, codeInjector, env, inlineFunctionStack, language, languageVersion, parserExtension, qNameParser, rangeVariables, scanOnly, t
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAfter parsing a selector, return the optimized version of the XPath expression that was parsedprotected Expression
Parse a relative path (a sequence of steps).parseSelector
(String expression, StaticContext env, boolean isField) Parse a string representing the restricted XPath expression allowed in an XML Schema selector or field attributeprotected Expression
Override the general XPath parsing of a StepExpression to support the simpler kind of Step used in XML Schema selectorsprotected Expression
Methods inherited from class net.sf.saxon.expr.parser.XPathParser
atStartOfRelativePath, checkLanguageVersion30, checkLanguageVersion31, checkLanguageVersion40, checkMapExtensions, checkSyntaxExtensions, createDynamicCurriedFunction, currentTokenDisplay, curryFunction, customizeTokenizer, declareRangeVariable, disallowedAtStartOfRelativePath, expect, findOuterRangeVariable, findOuterRangeVariable, findRangeVariable, generateApplyCall, getCodeInjector, getLanguage, getMissingFunctionExplanation, getPlainType, getQNameParser, getRangeVariables, getStaticContext, getTokenizer, grumble, grumble, grumble, grumble, grumble, handleExternalFunctionDeclaration, isAllowAbsentExpression, isAllowXPath31Syntax, isKeyword, isNamespaceTestAllowed, isReservedFunctionName, isReservedInQuery, makeCurriedFunction, makeFingerprint, makeInlineFunctionValue, makeLocalNameTest, makeLocation, makeLocation, makeNamespaceTest, makeNameTest, makeNestedLocation, makeNodeName, makeQNameTest, makeStringLiteral, makeStructuredQName, makeStructuredQNameSilently, makeTracer, nextToken, operatorPrecedence, parse, parseAnnotationsList, parseArrayCurlyConstructor, parseArrayItemType, parseArraySquareConstructor, parseArrowPostfix, parseBackTickedStringLiteral, parseBasicStep, parseBinaryExpression, parseBinaryLiteral, parseConstructor, parseDynamicFunctionCall, parseEnumType, parseExpression, parseExprSingle, parseExtendedItemType, parseExtendedSequenceType, parseExtensionExpression, parseFLWORExpression, parseFocusFunction, parseFunctionArgument, parseFunctionCall, parseFunctionItemType, parseHexLiteral, parseInlineFunction, parseInlineFunctionBody, parseItemType, parseLambdaParams, parseLookup, parseMapExpression, parseMapItemType, parseMappingArrowPostfix, parseNamedFunctionReference, parseNameTestUnion, parseNodeTest, parseNumericLiteral, parseOccurrenceIndicator, parseParenthesizedExpression, parsePathExpression, parsePredicate, parsePredicate, parseRemainingPath, parseSequenceType, parseSequenceType, parseSimpleMappingExpression, parseStepExpression, parseStringConstructor, parseStringLiteral, parseStringTemplate, parseSwitchExpression, parseTryCatchExpression, parseTypeswitchExpression, parseUnionNodeTest, parseUnionType, parseValidateExpression, parseVariableName, reportMissingFunction, resolveFunctionName, resolveVariableReference, setAccelerator, setAllowAbsentExpression, setCatchDepth, setCodeInjector, setLanguage, setLocation, setLocation, setLocation, setParserExtension, setQNameParser, setRangeVariables, setRangeVariableStack, setScanOnly, testPermittedAxis, undeclareRangeVariable, unescape, warning, whyDisallowedType
-
Constructor Details
-
Method Details
-
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 Stringenv
- the static context for the expressionisField
- true if the attribute is a "field" attribute, false if it is a "selector" attribute- Returns:
- a Pattern object representing the result of parsing. The expression
equivalent to this pattern may be obtained by calling
getOptimizedExpression()
. - Throws:
XPathException
- if the expression contains a syntax error
-
parseUnionExpression
- Throws:
XPathException
-
parseRelativePath
Description copied from class:XPathParser
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 classXPathParser
- Returns:
- the resulting subexpression
- Throws:
XPathException
- if any error is encountered
-
parseStepExpression
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
-
getOptimizedExpression
After parsing a selector, return the optimized version of the XPath expression that was parsed- Returns:
- the optimized XPath expression equivalent to the pattern that was created by parsing the selector
-