jd.xml.xslt.parser
Class TemplateParser

java.lang.Object
  extended byjd.xml.xslt.parser.Parser
      extended byjd.xml.xslt.parser.TemplateParser

public class TemplateParser
extends Parser

A parser for XSLT templates.


Field Summary
 
Fields inherited from class jd.xml.xslt.parser.Parser
context_, patternParser_
 
Constructor Summary
TemplateParser(PatternParser patternParser)
          Create a new TemplateParser.
 
Method Summary
protected  void expectExtensionElement(XPathNode parent, XPathNode node, String uri, String localName)
          Test if a node is a extension element
(package private)  Variable[] getVariableArray(Vector vars)
           
 Template parse(XPathNode node)
          Parse a template node, its children and siblings.
(package private)  CreateAttribute parseAttribute(XPathNode element, AttributeIterator attributes)
          
(package private)  AttributeValue parseOutputFormat(AttributeIterator attributes, OutputFormatTemplate formatTemplate, boolean isOutputInstruction)
          Parse a xsl:output or xsl:document instruction.
(package private)  Variable parseVariable(XPathNode element, int variableType, AttributeIterator attributes)
          
(package private)  Variable parseVariable(XPathNode element, int variableType, AttributeIterator attributes, boolean isGlobal)
           
(package private)  Vector parseVariable(XPathNode element, int variableType, Vector vars)
           
 void setParseListener(ParseListener parseListener)
          Set a ParseListener.
 
Methods inherited from class jd.xml.xslt.parser.Parser
getFirstStylesheetChild, getNextStylesheetSibling, getStylesheetNode, isStylesheetElement, isStylesheetElement, isStylesheetNode, parseExcludeResultPrefixes, parseExtensionElementPrefixes, parseNamespacePrefix, reportInvalidChild, reportMissingAttribute, setCurrentElement, setCurrentElement, throwException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateParser

public TemplateParser(PatternParser patternParser)
Create a new TemplateParser.

Method Detail

setParseListener

public void setParseListener(ParseListener parseListener)
Set a ParseListener.


parse

public Template parse(XPathNode node)
               throws XsltParseException
Parse a template node, its children and siblings.

Parameters:
node - the node
Returns:
the template created from this node
Throws:
jd.xml.xslt.parse.XsltParseException - thrown if the parsing fails
XsltParseException

parseAttribute

CreateAttribute parseAttribute(XPathNode element,
                               AttributeIterator attributes)
                         throws XsltParseException

Throws:
XsltParseException

parseVariable

Variable parseVariable(XPathNode element,
                       int variableType,
                       AttributeIterator attributes)
                 throws XsltParseException

Throws:
XsltParseException

parseVariable

Variable parseVariable(XPathNode element,
                       int variableType,
                       AttributeIterator attributes,
                       boolean isGlobal)
                 throws XsltParseException
Throws:
XsltParseException

parseVariable

Vector parseVariable(XPathNode element,
                     int variableType,
                     Vector vars)
               throws XsltParseException
Throws:
XsltParseException

getVariableArray

Variable[] getVariableArray(Vector vars)

parseOutputFormat

AttributeValue parseOutputFormat(AttributeIterator attributes,
                                 OutputFormatTemplate formatTemplate,
                                 boolean isOutputInstruction)
                           throws XsltParseException
Parse a xsl:output or xsl:document instruction.

Parameters:
attributes - an iterator for the attributes of the instructions elements
isOutputInstruction - is it from a xsl:output instruction (true) or a xsl:document instruction (false)
Returns:
the AVT of the href attribute in case of a xsl:document instruction, null else
Throws:
XsltParseException

expectExtensionElement

protected void expectExtensionElement(XPathNode parent,
                                      XPathNode node,
                                      String uri,
                                      String localName)
                               throws XsltParseException
Test if a node is a extension element

Throws:
XsltParseException