org.apache.xalan.xsltc.compiler
Class Parser

java.lang.Object
  extended by org.apache.xalan.xsltc.compiler.Parser
All Implemented Interfaces:
Constants, org.xml.sax.ContentHandler

public class Parser
extends java.lang.Object
implements Constants, org.xml.sax.ContentHandler


Field Summary
private  int _currentImportPrecedence
           
private  Stylesheet _currentStylesheet
           
private  java.util.Vector _errors
           
private  QName _excludeResultPrefixes
           
private  QName _extensionElementPrefixes
           
private  java.util.Hashtable _instructionAttrs
           
private  java.util.Hashtable _instructionClasses
           
private  org.xml.sax.Locator _locator
           
private  java.util.Hashtable _namespaces
           
private  Output _output
           
private  java.util.Stack _parentStack
          SAX2 ContentHandler INTERFACE
private  java.lang.String _PIcharset
           
private  java.lang.String _PImedia
           
private  java.lang.String _PItitle
           
private  java.util.Hashtable _prefixMapping
           
private  java.util.Hashtable _qNames
           
private  SyntaxTreeNode _root
           
private  boolean _rootNamespaceDef
           
private  SymbolTable _symbolTable
           
private  java.lang.String _target
           
private  Template _template
           
private  int _templateIndex
           
private  QName _useAttributeSets
           
private  java.util.Hashtable _variableScope
           
private  java.util.Vector _warnings
           
private  XPathParser _xpathParser
           
private  XSLTC _xsltc
           
private static java.lang.String TRANSLET
           
private  boolean versionIsOne
          Creates a new node in the abstract syntax tree.
private static java.lang.String XSL
           
 
Fields inherited from interface org.apache.xalan.xsltc.compiler.Constants
ABSOLUTE_ITERATOR, ACC_FINAL, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_SUPER, ADD_ATTRIBUTE, ADD_ATTRIBUTE_SIG, ADD_ITERATOR, ADD_ITERATOR_SIG, ADD_PARAMETER, ADD_PARAMETER_SIG, APPLY_TEMPLATES, ATTR_SET_SIG, ATTRIBUTE_LIST_FIELD, ATTRIBUTE_LIST_IMPL_CLASS, ATTRIBUTE_LIST_IMPL_SIG, ATTRIBUTES_SIG, BASIS_LIBRARY_CLASS, BOOLEAN_CLASS, BOOLEAN_VALUE, BOOLEAN_VALUE_SIG, CACHED_NODE_LIST_ITERATOR_CLASS, CHARACTERS, CHARACTERS_SIG, CHARACTERSW, CHARACTERSW_SIG, CLEAR_ATTRIBUTES, CLEAR_ATTRIBUTES_SIG, COLLATOR_CLASS, COLLATOR_SIG, COMPILER_PACKAGE, CURRENT_NODE_LIST_FILTER, CURRENT_NODE_LIST_FILTER_SIG, CURRENT_NODE_LIST_ITERATOR, CURRENT_NODE_LIST_ITERATOR_SIG, DEFAULT_NODE_COUNTER, DEFAULT_NODE_COUNTER_SIG, DOCUMENT_PNAME, DOM_ADAPTER_CLASS, DOM_ADAPTER_SIG, DOM_FIELD, DOM_IMPL, DOM_IMPL_CLASS, DOM_IMPL_SIG, DOM_INTF, DOM_INTF_SIG, DOM_PNAME, DOUBLE_CLASS, DOUBLE_SIG, DOUBLE_VALUE, DOUBLE_VALUE_SIG, DUP_FILTERED_ITERATOR, EMPTYATTR_FIELD, EMPTYSTRING, ERROR, EXPAND_STYLESHEET_QNAME_REF, EXPAND_STYLESHEET_QNAME_SIG, FALLBACK_CLASS, FATAL, FILTER_INTERFACE, FILTER_INTERFACE_SIG, FILTER_ITERATOR, FILTER_STEP_ITERATOR, FORMAT_SYMBOLS_FIELD, GET_ATTRIBUTE_VALUE, GET_ATTRIBUTE_VALUE_SIG, GET_CHILDREN, GET_CHILDREN_SIG, GET_ELEMENT_VALUE, GET_ELEMENT_VALUE_SIG, GET_ITERATOR_SIG, GET_NODE_NAME, GET_NODE_NAME_SIG, GET_NODE_TYPE, GET_NODE_TYPE_SIG, GET_NODE_VALUE, GET_NODE_VALUE_ITERATOR, GET_NODE_VALUE_ITERATOR_SIG, GET_NODE_VALUE_SIG, GET_PARAMETER, GET_PARAMETER_SIG, GET_PARENT, GET_PARENT_SIG, GET_TYPED_CHILDREN, GET_TYPED_CHILDREN_SIG, GET_UNPARSED_ENTITY_URI, GET_UNPARSED_ENTITY_URI_SIG, HAS_ATTRIBUTE, HAS_ATTRIBUTE_SIG, HASIDCALL_INDEX, HASIDCALL_INDEX_SIG, INT_VALUE, INT_VALUE_SIG, INTEGER_CLASS, INTEGER_SIG, INTERNAL, INVOKE_METHOD, ITERATOR_FIELD_SIG, ITERATOR_PNAME, KEY_INDEX_CLASS, KEY_INDEX_ITERATOR_SIG, KEY_INDEX_SIG, LAST_INDEX, LOAD_DOCUMENT_CLASS, LOCALE_CLASS, LOCALE_SIG, LOOKUP_STYLESHEET_QNAME_NS_REF, LOOKUP_STYLESHEET_QNAME_NS_SIG, MAKE_NODE, MAKE_NODE_LIST, MAKE_NODE_LIST_SIG, MAKE_NODE_LIST_SIG2, MAKE_NODE_SIG, MAKE_NODE_SIG2, MATCHING_ITERATOR, MATH_CLASS, MULTI_DOM_CLASS, MULTI_DOM_SIG, NAMES_INDEX, NAMES_INDEX_SIG, NAMESPACE_FEATURE, NAMESPACE_INDEX, NAMESPACE_INDEX_SIG, NEXT, NEXT_SIG, NEXTID, NODE, NODE_COUNTER, NODE_COUNTER_SIG, NODE_FIELD, NODE_FIELD_SIG, NODE_ITERATOR, NODE_ITERATOR_BASE, NODE_ITERATOR_SIG, NODE_PNAME, NODE_SIG, NODE_SORT_FACTORY, NODE_SORT_FACTORY_SIG, NODE_SORT_RECORD, NODE_SORT_RECORD_SIG, NS_ANCESTORS_INDEX_SIG, NTH_ITERATOR_CLASS, OBJECT_CLASS, OBJECT_SIG, ORDER_ITERATOR, ORDER_ITERATOR_SIG, OUTPUT_BASE, OUTPUT_HANDLER, OUTPUT_HANDLER_SIG, POP_PARAM_FRAME, POP_PARAM_FRAME_SIG, POSITION_INDEX, PREFIX_URIS_ARRAY_SIG, PREFIX_URIS_IDX_SIG, PUSH_PARAM_FRAME, PUSH_PARAM_FRAME_SIG, REDIRECT_URI, RESET, RESET_SIG, RTF_INITIAL_SIZE, RUNTIME_NODE_CLASS, RUNTIME_PACKAGE, SAX_IMPL, SAX_IMPL_CLASS, SAX_IMPL_SIG, SET_START_NODE, SET_START_NODE_SIG, SINGLETON_ITERATOR, SORT_ITERATOR, SORT_ITERATOR_SIG, STATIC_CHAR_DATA_FIELD, STATIC_CHAR_DATA_FIELD_SIG, STATIC_NAMES_ARRAY_FIELD, STATIC_NAMESPACE_ARRAY_FIELD, STATIC_NS_ANCESTORS_ARRAY_FIELD, STATIC_PREFIX_URIS_ARRAY_FIELD, STATIC_PREFIX_URIS_IDX_ARRAY_FIELD, STATIC_TYPES_ARRAY_FIELD, STATIC_URIS_ARRAY_FIELD, STEP_ITERATOR_CLASS, STREAM_XML_OUTPUT, STRING, STRING_BUFFER_CLASS, STRING_BUFFER_SIG, STRING_CLASS, STRING_SIG, STRING_TO_INT, STRING_TO_INT_SIG, STRING_TO_REAL, STRING_TO_REAL_SIG, STRING_VALUE_HANDLER, STRING_VALUE_HANDLER_SIG, STRING_WRITER, STRIP_SPACE, STRIP_SPACE_INTF, STRIP_SPACE_PARAMS, STRIP_SPACE_SIG, TRANSLET_CLASS, TRANSLET_FIELD, TRANSLET_FIELD_SIG, TRANSLET_INTF, TRANSLET_INTF_SIG, TRANSLET_OUTPUT_BASE, TRANSLET_OUTPUT_INTERFACE, TRANSLET_OUTPUT_PNAME, TRANSLET_OUTPUT_SIG, TRANSLET_PNAME, TRANSLET_SIG, TRANSLET_URI, TRANSLET_VERSION_INDEX, TRANSLET_VERSION_INDEX_SIG, TYPES_INDEX, TYPES_INDEX_SIG, UNION_ITERATOR_CLASS, UNION_ITERATOR_SIG, UNSUPPORTED, URIS_INDEX, URIS_INDEX_SIG, WARNING, WRITER_SIG, XHTML_URI, XMLNS_PREFIX, XMLNS_STRING, XMLNS_URI, XSLT_PACKAGE, XSLT_URI
 
Constructor Summary
Parser(XSLTC xsltc)
           
 
Method Summary
 void addParameter(Param param)
           
 void addVariable(Variable var)
           
private  void addVariableOrParam(VariableBase var)
           
 void characters(char[] ch, int start, int length)
          SAX2: Receive notification of character data.
private  void checkForSuperfluousAttributes(SyntaxTreeNode node, org.xml.sax.Attributes attrs)
          checks the list of attributes against a list of allowed attributes for a particular element node.
 void createAST(Stylesheet stylesheet)
          Instanciates a SAX2 parser and generate the AST from the input.
 boolean elementSupported(java.lang.String namespace, java.lang.String localName)
           
 void endDocument()
          SAX2: Receive notification of the end of a document.
 void endElement(java.lang.String uri, java.lang.String localname, java.lang.String qname)
          SAX2: Receive notification of the end of an element.
 void endPrefixMapping(java.lang.String prefix)
          SAX2: End the scope of a prefix-URI Namespace mapping.
 boolean errorsFound()
          Returns true if there were any errors during compilation
private  SyntaxTreeNode findStylesheet(SyntaxTreeNode root, java.lang.String href)
          Find a Stylesheet element with a specific ID attribute value.
 boolean functionSupported(java.lang.String fname)
           
 int getCurrentImportPrecedence()
           
 Stylesheet getCurrentStylesheet()
           
 SyntaxTreeNode getDocumentRoot()
           
 java.util.Vector getErrors()
           
 QName getExcludeResultPrefixes()
           
 QName getExtensionElementPrefixes()
           
private  int getLineNumber()
          Get the line number, or zero if there is no _locator.
 int getNextImportPrecedence()
           
 Output getOutput()
           
 java.util.Properties getOutputProperties()
           
 QName getQName(QName scope, QName name)
           
 QName getQName(java.lang.String stringRep)
           
 QName getQName(java.lang.String stringRep, boolean reportError)
           
private  QName getQName(java.lang.String stringRep, boolean reportError, boolean ignoreDefaultNs)
           
 QName getQName(java.lang.String scope, java.lang.String name)
           
 QName getQName(java.lang.String namespace, java.lang.String prefix, java.lang.String localname)
           
 QName getQNameIgnoreDefaultNs(java.lang.String stringRep)
           
 QName getQNameSafe(java.lang.String stringRep)
           
private  SyntaxTreeNode getStylesheet(SyntaxTreeNode root)
          Extracts the DOM for the stylesheet.
 SymbolTable getSymbolTable()
           
 Template getTemplate()
           
 int getTemplateIndex()
           
private  java.lang.String getTokenValue(java.lang.String token)
           
 Stylesheet getTopLevelStylesheet()
           
 QName getUseAttributeSets()
           
 java.util.Vector getWarnings()
           
 XSLTC getXSLTC()
           
 void ignorableWhitespace(char[] ch, int start, int length)
          IGNORED - all ignorable whitespace is ignored
 void init()
           
private  void initAttrTable(java.lang.String elementName, java.lang.String[] attrs)
           
private  void initExtClass(java.lang.String elementName, java.lang.String className)
           
private  void initExtClass(java.lang.String namespace, java.lang.String elementName, java.lang.String className)
           
private  void initExtClasses()
           
private  void initInstructionAttrs()
           
private  void initStdClass(java.lang.String elementName, java.lang.String className)
           
private  void initStdClasses()
          Initialize the _instructionClasses Hashtable, which maps XSL element names to Java classes in this package.
private  void initSymbolTable()
          Add primops and base functions to the symbol table.
private  SyntaxTreeNode loadExternalStylesheet(java.lang.String location)
          For embedded stylesheets: Load an external file with stylesheet
 VariableBase lookupVariable(QName name)
           
 SyntaxTreeNode makeInstance(java.lang.String uri, java.lang.String prefix, java.lang.String local, org.xml.sax.Attributes attributes)
           
 Stylesheet makeStylesheet(SyntaxTreeNode element)
          Create an instance of the Stylesheet class, and then parse, typecheck and compile the instance.
 SyntaxTreeNode parse(org.xml.sax.InputSource input)
          Parses a stylesheet and builds the internal abstract syntax tree
 SyntaxTreeNode parse(org.xml.sax.XMLReader reader, org.xml.sax.InputSource input)
          Parses a stylesheet and builds the internal abstract syntax tree
 Expression parseExpression(SyntaxTreeNode parent, java.lang.String exp)
          Parse an XPath expression:
 Expression parseExpression(SyntaxTreeNode parent, java.lang.String attr, java.lang.String def)
          Parse an XPath expression:
 Pattern parsePattern(SyntaxTreeNode parent, java.lang.String pattern)
          Parse an XPath pattern:
 Pattern parsePattern(SyntaxTreeNode parent, java.lang.String attr, java.lang.String def)
          Parse an XPath pattern:
private  SyntaxTreeNode parseTopLevel(SyntaxTreeNode parent, java.lang.String text, java.lang.String expression)
          Parse an XPath expression or pattern using the generated XPathParser The method will return a Dummy node if the XPath parser fails.
 void printErrors()
          Prints all compile-time errors
 void printWarnings()
          Prints all compile-time warnings
 void processingInstruction(java.lang.String name, java.lang.String value)
          SAX2: Receive notification of a processing instruction.
 void removeVariable(QName name)
           
 void reportError(int category, ErrorMsg error)
          Common error/warning message handler
 void setCurrentStylesheet(Stylesheet stylesheet)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
          Store the document locator to later retrieve line numbers of all elements from the stylesheet
 void setOutput(Output output)
           
protected  void setPIParameters(java.lang.String media, java.lang.String title, java.lang.String charset)
          Set the parameters to use to locate the correct processing instruction in the case where the input document is an XML document with one or more references to a stylesheet.
 void setTemplate(Template template)
           
 void setXSLTC(XSLTC xsltc)
           
 void skippedEntity(java.lang.String name)
          IGNORED - we do not have to do anything with skipped entities
 void startDocument()
          SAX2: Receive notification of the beginning of a document.
 void startElement(java.lang.String uri, java.lang.String localname, java.lang.String qname, org.xml.sax.Attributes attributes)
          SAX2: Receive notification of the beginning of an element.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          SAX2: Begin the scope of a prefix-URI Namespace mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XSL

private static final java.lang.String XSL
See Also:
Constant Field Values

TRANSLET

private static final java.lang.String TRANSLET
See Also:
Constant Field Values

_locator

private org.xml.sax.Locator _locator

_xsltc

private XSLTC _xsltc

_xpathParser

private XPathParser _xpathParser

_errors

private java.util.Vector _errors

_warnings

private java.util.Vector _warnings

_instructionClasses

private java.util.Hashtable _instructionClasses

_instructionAttrs

private java.util.Hashtable _instructionAttrs

_qNames

private java.util.Hashtable _qNames

_namespaces

private java.util.Hashtable _namespaces

_useAttributeSets

private QName _useAttributeSets

_excludeResultPrefixes

private QName _excludeResultPrefixes

_extensionElementPrefixes

private QName _extensionElementPrefixes

_variableScope

private java.util.Hashtable _variableScope

_currentStylesheet

private Stylesheet _currentStylesheet

_symbolTable

private SymbolTable _symbolTable

_output

private Output _output

_template

private Template _template

_rootNamespaceDef

private boolean _rootNamespaceDef

_root

private SyntaxTreeNode _root

_target

private java.lang.String _target

_currentImportPrecedence

private int _currentImportPrecedence

_PImedia

private java.lang.String _PImedia

_PItitle

private java.lang.String _PItitle

_PIcharset

private java.lang.String _PIcharset

_templateIndex

private int _templateIndex

versionIsOne

private boolean versionIsOne
Creates a new node in the abstract syntax tree. This node can be o) a supported XSLT 1.0 element o) an unsupported XSLT element (post 1.0) o) a supported XSLT extension o) an unsupported XSLT extension o) a literal result element (not an XSLT element and not an extension) Unsupported elements do not directly generate an error. We have to wait until we have received all child elements of an unsupported element to see if any elements exist.


_parentStack

private java.util.Stack _parentStack
SAX2 ContentHandler INTERFACE


_prefixMapping

private java.util.Hashtable _prefixMapping
Constructor Detail

Parser

public Parser(XSLTC xsltc)
Method Detail

init

public void init()

setOutput

public void setOutput(Output output)

getOutput

public Output getOutput()

getOutputProperties

public java.util.Properties getOutputProperties()

addVariable

public void addVariable(Variable var)

addParameter

public void addParameter(Param param)

addVariableOrParam

private void addVariableOrParam(VariableBase var)

removeVariable

public void removeVariable(QName name)

lookupVariable

public VariableBase lookupVariable(QName name)

setXSLTC

public void setXSLTC(XSLTC xsltc)

getXSLTC

public XSLTC getXSLTC()

getCurrentImportPrecedence

public int getCurrentImportPrecedence()

getNextImportPrecedence

public int getNextImportPrecedence()

setCurrentStylesheet

public void setCurrentStylesheet(Stylesheet stylesheet)

getCurrentStylesheet

public Stylesheet getCurrentStylesheet()

getTopLevelStylesheet

public Stylesheet getTopLevelStylesheet()

getQNameSafe

public QName getQNameSafe(java.lang.String stringRep)

getQName

public QName getQName(java.lang.String stringRep)

getQNameIgnoreDefaultNs

public QName getQNameIgnoreDefaultNs(java.lang.String stringRep)

getQName

public QName getQName(java.lang.String stringRep,
                      boolean reportError)

getQName

private QName getQName(java.lang.String stringRep,
                       boolean reportError,
                       boolean ignoreDefaultNs)

getQName

public QName getQName(java.lang.String namespace,
                      java.lang.String prefix,
                      java.lang.String localname)

getQName

public QName getQName(java.lang.String scope,
                      java.lang.String name)

getQName

public QName getQName(QName scope,
                      QName name)

getUseAttributeSets

public QName getUseAttributeSets()

getExtensionElementPrefixes

public QName getExtensionElementPrefixes()

getExcludeResultPrefixes

public QName getExcludeResultPrefixes()

makeStylesheet

public Stylesheet makeStylesheet(SyntaxTreeNode element)
                          throws CompilerException
Create an instance of the Stylesheet class, and then parse, typecheck and compile the instance. Must be called after parse().

Throws:
CompilerException

createAST

public void createAST(Stylesheet stylesheet)
Instanciates a SAX2 parser and generate the AST from the input.


parse

public SyntaxTreeNode parse(org.xml.sax.XMLReader reader,
                            org.xml.sax.InputSource input)
Parses a stylesheet and builds the internal abstract syntax tree

Parameters:
reader - A SAX2 SAXReader (parser)
input - A SAX2 InputSource can be passed to a SAX reader
Returns:
The root of the abstract syntax tree

parse

public SyntaxTreeNode parse(org.xml.sax.InputSource input)
Parses a stylesheet and builds the internal abstract syntax tree

Parameters:
input - A SAX2 InputSource can be passed to a SAX reader
Returns:
The root of the abstract syntax tree

getDocumentRoot

public SyntaxTreeNode getDocumentRoot()

setPIParameters

protected void setPIParameters(java.lang.String media,
                               java.lang.String title,
                               java.lang.String charset)
Set the parameters to use to locate the correct processing instruction in the case where the input document is an XML document with one or more references to a stylesheet.

Parameters:
media - The media attribute to be matched. May be null, in which case the prefered templates will be used (i.e. alternate = no).
title - The value of the title attribute to match. May be null.
charset - The value of the charset attribute to match. May be null.

getStylesheet

private SyntaxTreeNode getStylesheet(SyntaxTreeNode root)
                              throws CompilerException
Extracts the DOM for the stylesheet. In the case of an embedded stylesheet, it extracts the DOM subtree corresponding to the embedded stylesheet that has an 'id' attribute whose value is the same as the value declared in the processing instruction (P.I.). In the xml-stylesheet P.I. the value is labeled as the 'href' data of the P.I. The extracted DOM representing the stylesheet is returned as an Element object.

Throws:
CompilerException

findStylesheet

private SyntaxTreeNode findStylesheet(SyntaxTreeNode root,
                                      java.lang.String href)
Find a Stylesheet element with a specific ID attribute value. This method is used to find a Stylesheet node that is referred in a processing instruction.


loadExternalStylesheet

private SyntaxTreeNode loadExternalStylesheet(java.lang.String location)
                                       throws CompilerException
For embedded stylesheets: Load an external file with stylesheet

Throws:
CompilerException

initAttrTable

private void initAttrTable(java.lang.String elementName,
                           java.lang.String[] attrs)

initInstructionAttrs

private void initInstructionAttrs()

initStdClasses

private void initStdClasses()
Initialize the _instructionClasses Hashtable, which maps XSL element names to Java classes in this package.


initStdClass

private void initStdClass(java.lang.String elementName,
                          java.lang.String className)

elementSupported

public boolean elementSupported(java.lang.String namespace,
                                java.lang.String localName)

functionSupported

public boolean functionSupported(java.lang.String fname)

initExtClasses

private void initExtClasses()

initExtClass

private void initExtClass(java.lang.String elementName,
                          java.lang.String className)

initExtClass

private void initExtClass(java.lang.String namespace,
                          java.lang.String elementName,
                          java.lang.String className)

initSymbolTable

private void initSymbolTable()
Add primops and base functions to the symbol table.


getSymbolTable

public SymbolTable getSymbolTable()

getTemplate

public Template getTemplate()

setTemplate

public void setTemplate(Template template)

getTemplateIndex

public int getTemplateIndex()

makeInstance

public SyntaxTreeNode makeInstance(java.lang.String uri,
                                   java.lang.String prefix,
                                   java.lang.String local,
                                   org.xml.sax.Attributes attributes)

checkForSuperfluousAttributes

private void checkForSuperfluousAttributes(SyntaxTreeNode node,
                                           org.xml.sax.Attributes attrs)
checks the list of attributes against a list of allowed attributes for a particular element node.


parseExpression

public Expression parseExpression(SyntaxTreeNode parent,
                                  java.lang.String exp)
Parse an XPath expression:

Parameters:
parent - - XSL element where the expression occured
exp - - textual representation of the expression

parseExpression

public Expression parseExpression(SyntaxTreeNode parent,
                                  java.lang.String attr,
                                  java.lang.String def)
Parse an XPath expression:

Parameters:
parent - - XSL element where the expression occured
attr - - name of this element's attribute to get expression from
def - - default expression (if the attribute was not found)

parsePattern

public Pattern parsePattern(SyntaxTreeNode parent,
                            java.lang.String pattern)
Parse an XPath pattern:

Parameters:
parent - - XSL element where the pattern occured
pattern - - textual representation of the pattern

parsePattern

public Pattern parsePattern(SyntaxTreeNode parent,
                            java.lang.String attr,
                            java.lang.String def)
Parse an XPath pattern:

Parameters:
parent - - XSL element where the pattern occured
attr - - name of this element's attribute to get pattern from
def - - default pattern (if the attribute was not found)

parseTopLevel

private SyntaxTreeNode parseTopLevel(SyntaxTreeNode parent,
                                     java.lang.String text,
                                     java.lang.String expression)
Parse an XPath expression or pattern using the generated XPathParser The method will return a Dummy node if the XPath parser fails.


errorsFound

public boolean errorsFound()
Returns true if there were any errors during compilation


printErrors

public void printErrors()
Prints all compile-time errors


printWarnings

public void printWarnings()
Prints all compile-time warnings


reportError

public void reportError(int category,
                        ErrorMsg error)
Common error/warning message handler


getErrors

public java.util.Vector getErrors()

getWarnings

public java.util.Vector getWarnings()

startDocument

public void startDocument()
SAX2: Receive notification of the beginning of a document.

Specified by:
startDocument in interface org.xml.sax.ContentHandler

endDocument

public void endDocument()
SAX2: Receive notification of the end of a document.

Specified by:
endDocument in interface org.xml.sax.ContentHandler

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
SAX2: Begin the scope of a prefix-URI Namespace mapping. This has to be passed on to the symbol table!

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
SAX2: End the scope of a prefix-URI Namespace mapping. This has to be passed on to the symbol table!

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localname,
                         java.lang.String qname,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
SAX2: Receive notification of the beginning of an element. The parser may re-use the attribute list that we're passed so we clone the attributes in our own Attributes implementation

Specified by:
startElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localname,
                       java.lang.String qname)
SAX2: Receive notification of the end of an element.

Specified by:
endElement in interface org.xml.sax.ContentHandler

characters

public void characters(char[] ch,
                       int start,
                       int length)
SAX2: Receive notification of character data.

Specified by:
characters in interface org.xml.sax.ContentHandler

getTokenValue

private java.lang.String getTokenValue(java.lang.String token)

processingInstruction

public void processingInstruction(java.lang.String name,
                                  java.lang.String value)
SAX2: Receive notification of a processing instruction. These require special handling for stylesheet PIs.

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
IGNORED - all ignorable whitespace is ignored

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler

skippedEntity

public void skippedEntity(java.lang.String name)
IGNORED - we do not have to do anything with skipped entities

Specified by:
skippedEntity in interface org.xml.sax.ContentHandler

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Store the document locator to later retrieve line numbers of all elements from the stylesheet

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler

getLineNumber

private int getLineNumber()
Get the line number, or zero if there is no _locator.