jd.xml.xslt.parser
Class Parser

java.lang.Object
  extended byjd.xml.xslt.parser.Parser
Direct Known Subclasses:
StylesheetParser, TemplateParser

public abstract class Parser
extends Object

A base class for XSLT related parsers.


Field Summary
protected  XsltParseContext context_
           
protected  PatternParser patternParser_
           
 
Constructor Summary
protected Parser(PatternParser patternParser)
          Create a Parser.
 
Method Summary
protected  XPathNode getFirstStylesheetChild(XPathNode node)
          Get the first child that is a stylesheet node.
protected  XPathNode getNextStylesheetSibling(XPathNode node)
          Get the next sibling that is a stylesheet node.
protected  XPathNode getStylesheetNode(XPathNode node)
          Skip comments and processing instructions which are ignored in a stylesheet.
protected  boolean isStylesheetElement(XPathNode node)
          Test if the node is a stylesheet element, i.e.
 boolean isStylesheetElement(XPathNode node, String localName)
          Test if the node is a stylesheet element with the given local name.
 boolean isStylesheetNode(XPathNode node)
          Test if the node is a stylesheet node, i.e.
protected  void parseExcludeResultPrefixes(XPathNode attribute)
           
protected  void parseExtensionElementPrefixes(XPathNode attribute)
           
protected  String parseNamespacePrefix(String prefix)
           
protected  void reportInvalidChild(XPathNode child, boolean ignoreWhitespaceText)
           
protected  void reportMissingAttribute(String name)
           
protected  AttributeIterator setCurrentElement(XPathNode element)
          Calls setCurrentElement(element, true).
protected  AttributeIterator setCurrentElement(XPathNode element, boolean isStylesheetElem)
          Set the current parsed element (either a stylesheet or a literal element) and return an iterator for all relevant attributes of the element.
protected  void throwException(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context_

protected XsltParseContext context_

patternParser_

protected PatternParser patternParser_
Constructor Detail

Parser

protected Parser(PatternParser patternParser)
Create a Parser.

Method Detail

setCurrentElement

protected AttributeIterator setCurrentElement(XPathNode element,
                                              boolean isStylesheetElem)
                                       throws XsltParseException
Set the current parsed element (either a stylesheet or a literal element) and return an iterator for all relevant attributes of the element.

Parameters:
element - the new current parsed element
isStylesheetElem - true if it is a stylesheet element, false for a literal element.
Returns:
an iterator for the relevant attributes. Attributes are returned if the element is a stylesheet element and the attribute is a stylesheet attribute or if the element is a literal element.
Throws:
XsltParseException

setCurrentElement

protected AttributeIterator setCurrentElement(XPathNode element)
                                       throws XsltParseException
Calls setCurrentElement(element, true).

Throws:
XsltParseException

isStylesheetNode

public boolean isStylesheetNode(XPathNode node)
Test if the node is a stylesheet node, i.e. belongs to XSLT namespace.


isStylesheetElement

protected boolean isStylesheetElement(XPathNode node)
Test if the node is a stylesheet element, i.e. is an element and belongs to XSLT namespace.


isStylesheetElement

public boolean isStylesheetElement(XPathNode node,
                                   String localName)
Test if the node is a stylesheet element with the given local name.


getStylesheetNode

protected XPathNode getStylesheetNode(XPathNode node)
Skip comments and processing instructions which are ignored in a stylesheet.

Returns:
the node itself if it is a stylesheet node or the first sibling that is a stylesheet node.

getFirstStylesheetChild

protected XPathNode getFirstStylesheetChild(XPathNode node)
Get the first child that is a stylesheet node.


getNextStylesheetSibling

protected XPathNode getNextStylesheetSibling(XPathNode node)
Get the next sibling that is a stylesheet node.


parseExcludeResultPrefixes

protected void parseExcludeResultPrefixes(XPathNode attribute)
                                   throws XsltParseException
Throws:
XsltParseException

parseExtensionElementPrefixes

protected void parseExtensionElementPrefixes(XPathNode attribute)
                                      throws XsltParseException
Throws:
XsltParseException

parseNamespacePrefix

protected String parseNamespacePrefix(String prefix)

throwException

protected void throwException(String message)
                       throws XsltParseException
Throws:
XsltParseException

reportMissingAttribute

protected void reportMissingAttribute(String name)
                               throws XsltParseException
Throws:
XsltParseException

reportInvalidChild

protected void reportInvalidChild(XPathNode child,
                                  boolean ignoreWhitespaceText)
                           throws XsltParseException
Throws:
XsltParseException