com.novell.xsl.pattern
Class Parser

java.lang.Object
  extended bycom.novell.xml.xpath.Parser
      extended bycom.novell.xsl.parser.ExpressionParser
          extended bycom.novell.xsl.pattern.Parser

public class Parser
extends ExpressionParser

Parser for XSLT Patterns


Field Summary
 
Fields inherited from class com.novell.xsl.parser.ExpressionParser
stylesheetParser
 
Constructor Summary
Parser(StylesheetParser stylesheetParser, VariableBindings variables, FunctionLibrary library, NamespaceContext nsContext)
          Construct a parser with the passed function library and namespace context.
 
Method Summary
protected  NodeTestPattern parseAxisSpecifier()
           
protected  Pattern parseIdKeyPattern()
           
protected  Pattern parseLocationPathPattern()
           
protected  Pattern parsePattern()
           
 Pattern parsePattern(String source, boolean topLevel)
          Parse a string as an XSLT pattern an return the resulting object that implements the Pattern interface.
protected  RelativePathPattern parseRelativePathPattern()
           
protected  StepPattern parseStepPattern()
           
 
Methods inherited from class com.novell.xsl.parser.ExpressionParser
parseFunctionCall
 
Methods inherited from class com.novell.xml.xpath.Parser
getDefaultFunctionLibrary, getLibrary, getOperator, getTokens, getVariables, nextToken, parse, parse, parse, parseAdditiveExpr, parseAndExpr, parseArgumentList, parseBasis, parseEqualityExpr, parseExpr, parseFilterExpr, parseLocationPath, parseMultiplicativeExpr, parseNodeTest, parseOrExpr, parsePathExpr, parsePredicate, parsePrimaryExpr, parseRelationalExpr, parseRelativeLocationPath, parseStep, parseUnaryExpr, parseUnionExpr, peekToken, setBrokenMode, tokenize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser(StylesheetParser stylesheetParser,
              VariableBindings variables,
              FunctionLibrary library,
              NamespaceContext nsContext)
Construct a parser with the passed function library and namespace context. The function library and namespace contexts are needed for Predicate expressions in the pattern, and the namespace context are also needed by WildcardNames for matching.

Parameters:
stylesheetParser - The StylesheetParser associated with the expression. Used to get forwards-compatible mode state.
variables - The variable bindings in effect for the pattern.
library - The function library to use.
nsContext - The namespace context to use.
Method Detail

parsePattern

public Pattern parsePattern(String source,
                            boolean topLevel)
                     throws XPathParserException
Parse a string as an XSLT pattern an return the resulting object that implements the Pattern interface.

Parameters:
source - The string to parse.
topLevel - true if this is a top-level pattern (variable references not allowed)
Returns:
An object that implements the Pattern interface.
Throws:
XPathParserException

parsePattern

protected Pattern parsePattern()
                        throws XPathParserException
Throws:
XPathParserException

parseLocationPathPattern

protected Pattern parseLocationPathPattern()
                                    throws XPathParserException
Throws:
XPathParserException

parseIdKeyPattern

protected Pattern parseIdKeyPattern()
                             throws XPathParserException
Throws:
XPathParserException

parseRelativePathPattern

protected RelativePathPattern parseRelativePathPattern()
                                                throws XPathParserException
Throws:
XPathParserException

parseStepPattern

protected StepPattern parseStepPattern()
                                throws XPathParserException
Throws:
XPathParserException

parseAxisSpecifier

protected NodeTestPattern parseAxisSpecifier()
                                      throws XPathParserException
Throws:
XPathParserException