com.caucho.xsl
Class JavaGenerator

java.lang.Object
  extended by com.caucho.xsl.JavaGenerator

public class JavaGenerator
extends java.lang.Object

Generates code for a Java based stylesheet.

 package work.xsl;
 public class foo extends JavaStylesheet {
 }
 


Field Summary
protected  java.util.ArrayList<java.lang.String> _cacheDepends
           
protected  java.util.ArrayList<Path> _depends
           
protected  int _destLine
           
protected  org.w3c.dom.Document _doc
           
protected  java.lang.String _encoding
           
protected  java.lang.String _errorPage
           
protected  java.util.HashMap<java.lang.String,java.lang.String> _excludedNamespaces
           
protected  FormatNumberFun _formatNumberFun
           
protected  java.util.ArrayList _globalActions
           
protected  java.util.ArrayList<java.lang.String> _globalParameters
           
protected  java.util.ArrayList<java.lang.String> _imports
           
protected  boolean _isRawText
           
protected  boolean _isSpecial
           
protected  boolean _isStyleScript
           
protected  KeyFun _keyFun
           
protected  LineMap _lineMap
           
protected  NamespaceContext _namespace
           
protected  java.util.HashMap<java.lang.String,java.lang.String[]> _namespaceAliases
           
protected  AbstractPattern _nodeListContext
           
protected  java.util.HashMap<java.lang.String,java.lang.String> _preserve
           
protected  CauchoDocument _qDoc
           
protected  java.util.HashMap<java.lang.String,java.lang.String> _strip
           
protected  AbstractStylesheetFactory _xslGenerator
           
protected static L10N L
           
static java.lang.String XSLNS
           
static java.lang.String XTPNS
           
 
Method Summary
 void addAttributeSet(java.lang.String name, XslAttributeSet attributeSet)
          Scans through the stylesheet, grabbing the attribute set definitions.
 void addExcludedNamespace(java.lang.String ns)
           
 int addExpr(Expr expr)
          Adds an expression constant returning its index.
 int addExpr(java.lang.String exprString)
          Adds an expression constant returning its index.
 int addFormat(XslNumberFormat format)
           
 void addGlobalParameter(java.lang.String param)
           
 void addImport(java.lang.String pkg)
          Adds a Java import to the generated stylesheet.
 void addImportList(java.lang.String value)
           
 void addInit(XslNode node)
           
 void addKey(java.lang.String name, AbstractPattern match, Expr use)
           
 void addLocale(java.lang.String name, java.text.DecimalFormatSymbols format)
           
 void addMacro(java.lang.String name, java.lang.String functionName)
           
 int addMatch(AbstractPattern pattern)
          Adds a match pattern, returning its index.
 void addMode(java.lang.String mode)
           
protected  NamespaceContext addNamespace(org.w3c.dom.Element elt)
          Adds the namespaces in the element to the current NamespaceContext.
 int addNamespace(NamespaceContext namespace)
           
 void addNamespaceAlias(java.lang.String stylesheetPrefix, java.lang.String resultPrefix)
           
 void addNamespaceAlias(java.lang.String namespace, java.lang.String[] result)
           
 void addPreserveSpace(java.lang.String elements)
           
 int addSelect(AbstractPattern select)
          Adds a select pattern returning its index.
 int addSelect(java.lang.String selectString)
          Adds a select pattern, returning its index.
 int addSort(Sort[] sort)
           
 void addStripSpace(java.lang.String elements)
           
 int addStylesheet(java.lang.String filename)
           
 void clearUnique()
           
 void close()
          Close call when an error occurs.
protected  StylesheetImpl completeGenerate(java.util.ArrayList<XslNode> inits, java.util.ArrayList globals)
           
protected  XslNode createChild(org.w3c.dom.Node child)
           
protected  XslNode createChild(XslNode parent, org.w3c.dom.Node childNode)
           
 java.lang.String createTemplatePattern(java.lang.String name, AbstractPattern match, java.lang.String mode, double priority)
          Generates the pattern for a matching pattern
protected  void endDisableEscaping()
           
 StylesheetImpl generate(org.w3c.dom.Node node)
          Starts the generation from the top of the document.
protected  void generateChild(org.w3c.dom.Node child)
           
 void generateChild(org.w3c.dom.Node child, int code)
           
 void generateChildImpl(org.w3c.dom.Node child)
           
protected  void generateChildren(org.w3c.dom.Node node)
           
 int generateId()
           
 XslNode generateImport(java.lang.String href)
           
 void generateInclude(XslNode parent, java.lang.String href)
           
 java.util.HashMap<java.lang.String,java.lang.String> getAttributeSet(java.lang.String name)
          Returns the named attribute set.
 java.util.ArrayList<XslAttribute> getAttributeSetList(java.lang.String name)
          Returns the named attribute set.
 int getCallDepth()
           
 java.lang.String getCurrentPosition()
           
 boolean getDisableOutputEscaping()
           
 java.lang.String getElement()
           
 java.lang.String getEnv()
           
 int getImportance()
           
 java.lang.String getMacroName(java.lang.String name)
           
 int getMaxImportance()
           
 int getMinImportance()
           
 java.lang.String getModeName(java.lang.String mode)
          Returns the name of the applyNode method.
 NamespaceContext getNamespace()
           
 java.lang.String[] getNamespaceAlias(java.lang.String namespace)
           
 AbstractPattern getNodeListContext()
           
protected  JavaWriter getOut()
           
 int getSelectDepth()
           
 int getSelectLoopDepth()
           
protected  java.lang.String getXslLocal(org.w3c.dom.Node node)
          Returns the local name of an XSL element.
protected  java.lang.String getXtpLocal(org.w3c.dom.Node node)
           
 boolean hasMacro(java.lang.String name)
           
 void incrementImportance()
           
 Expr parseExpr(java.lang.String pattern)
           
 AbstractPattern parseMatch(java.lang.String pattern)
           
 AbstractPattern parseSelect(java.lang.String pattern)
           
protected  AbstractPattern parseSelect(java.lang.String pattern, org.w3c.dom.Node node)
           
protected  void popCall()
           
 int popCallDepth()
           
 void popLoop()
           
 int popSelectDepth()
           
 int popSelectLoopDepth()
           
protected  void printApplyImports(java.lang.String mode, int min, int max)
          Prints code to implement xsl:apply-imports
protected  void printApplyTemplates(AbstractPattern select, java.lang.String mode, Sort[] sort)
          Prints code for xsl:apply-templates
protected  void printAssign(java.lang.String name, java.lang.Object value)
           
protected  void printAttribute(org.w3c.dom.Element element, java.lang.String name)
          Prints an xsl:attribute
protected  void printAttribute(org.w3c.dom.Element element, java.lang.String name, java.lang.String namespace)
           
protected  void printCacheDepends(java.lang.String name)
           
protected  void printCallTemplate(java.lang.String name, java.lang.String mode)
           
protected  void printChoose(org.w3c.dom.Element element, Expr expr, boolean first)
           
protected  void printComment(org.w3c.dom.Element element)
           
protected  void printCopy(org.w3c.dom.Element element)
           
protected  void printCopyElement(org.w3c.dom.Element element)
           
protected  void printCopyOf(java.lang.String select, org.w3c.dom.Element elt)
           
protected  void printDeclaration(org.w3c.dom.Element element)
           
protected  void printElement(org.w3c.dom.Element element, java.lang.String name)
           
protected  void printElement(org.w3c.dom.Element element, java.lang.String name, java.lang.String namespace)
           
protected  void printElement(org.w3c.dom.Node node)
           
protected  void printError(java.lang.String msg)
           
protected  void printExpression(org.w3c.dom.Element element)
          Prints code to implement the xtp:expression tag, i.e.
 void printExprTest(int exprId, java.lang.String element)
           
protected  void printForEach(org.w3c.dom.Element element, java.lang.String select)
           
protected  void printForEach(org.w3c.dom.Element element, java.lang.String select, Sort[] sort)
          Prints code for xsl:for-each when the for-each has any xsl:sort.
protected  void printHeader()
          Prints the generated header.
protected  void printIf(org.w3c.dom.Element element, Expr test)
           
protected  void printInit()
           
protected  void printInitVars(java.util.ArrayList<XslNode> inits)
          Generate code executed for all transformations.
 void printLocation(java.lang.String systemId, java.lang.String filename, int line)
          Prints a command to set the current file and line into the generated document.
protected  void printMessage(org.w3c.dom.Element msg)
           
 void printNamespace(NamespaceContext namespace)
           
protected  void printOtherwise(org.w3c.dom.Element element, boolean first)
           
protected  void printParam(java.lang.String name, java.lang.Object value)
           
protected  void printParam(java.lang.String name, java.lang.String value, org.w3c.dom.Element elt)
          Prints the value for a parameter.
protected  void printParamVariable(java.lang.String name, org.w3c.dom.Element value)
           
protected  void printParamVariable(java.lang.String name, Expr value)
          Prints code to add the value of an expression as a parameter.
protected  void printPi(org.w3c.dom.Element element)
           
protected  void printPopScope(int count)
           
protected  void printResultDocument(org.w3c.dom.Element element, java.lang.String href, java.lang.String format)
           
protected  void printScriptlet(org.w3c.dom.Element element)
           
protected  void printSelectValue(java.lang.String select, org.w3c.dom.Element elt)
           
protected  void printString(java.lang.String str)
          Prints the contents of a string, taking care of escapes.
protected  void printTemplate(org.w3c.dom.Element absNode, java.lang.String name, java.lang.String pattern, java.lang.String mode, double priority)
          Generates code for a template
protected  void printVariable(java.lang.String name, java.lang.Object value)
           
protected  void printWhile(org.w3c.dom.Element element, Expr test)
           
protected  void pushCall()
           
 int pushCallDepth()
           
 void pushLoop()
           
 int pushSelectDepth()
           
 int pushSelectLoopDepth()
           
 void setContentType(java.lang.String type)
           
 void setCurrentPosition(java.lang.String pos)
           
 void setDisableOutputEscaping(boolean disable)
           
 void setErrorPage(java.lang.String errorPage)
           
 void setLocation(java.lang.String systemId, java.lang.String filename, int line)
           
 void setMinImportance(int importance)
           
 void setNodeListContext(AbstractPattern context)
           
 void setOutputAttribute(java.lang.String name, java.lang.String value)
           
 void setSelectDepth(int depth)
           
 void setSelectLoopDepth(int depth)
           
 void setStyleScript(boolean stylescript)
           
protected  void startDisableEscaping()
           
 java.lang.String toJavaIdentifier(java.lang.String name)
          Converts a string to a Java identifier, encoding unknown characters as "_"
 int uniqueId()
          Generates a uniqueId
protected  void writeText(java.lang.String text)
          Creates Java code to print plain text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L

protected static final L10N L

XSLNS

public static final java.lang.String XSLNS
See Also:
Constant Field Values

XTPNS

public static final java.lang.String XTPNS
See Also:
Constant Field Values

_preserve

protected java.util.HashMap<java.lang.String,java.lang.String> _preserve

_strip

protected java.util.HashMap<java.lang.String,java.lang.String> _strip

_namespaceAliases

protected java.util.HashMap<java.lang.String,java.lang.String[]> _namespaceAliases

_excludedNamespaces

protected java.util.HashMap<java.lang.String,java.lang.String> _excludedNamespaces

_keyFun

protected KeyFun _keyFun

_formatNumberFun

protected FormatNumberFun _formatNumberFun

_namespace

protected NamespaceContext _namespace

_globalActions

protected java.util.ArrayList _globalActions

_globalParameters

protected java.util.ArrayList<java.lang.String> _globalParameters

_doc

protected org.w3c.dom.Document _doc

_qDoc

protected CauchoDocument _qDoc

_lineMap

protected LineMap _lineMap

_destLine

protected int _destLine

_encoding

protected java.lang.String _encoding

_depends

protected java.util.ArrayList<Path> _depends

_cacheDepends

protected java.util.ArrayList<java.lang.String> _cacheDepends

_isRawText

protected boolean _isRawText

_errorPage

protected java.lang.String _errorPage

_nodeListContext

protected AbstractPattern _nodeListContext

_isSpecial

protected boolean _isSpecial

_isStyleScript

protected boolean _isStyleScript

_xslGenerator

protected AbstractStylesheetFactory _xslGenerator

_imports

protected java.util.ArrayList<java.lang.String> _imports
Method Detail

getOut

protected JavaWriter getOut()

getSelectDepth

public int getSelectDepth()

setSelectDepth

public void setSelectDepth(int depth)

pushSelectDepth

public int pushSelectDepth()

popSelectDepth

public int popSelectDepth()

getSelectLoopDepth

public int getSelectLoopDepth()

pushSelectLoopDepth

public int pushSelectLoopDepth()

popSelectLoopDepth

public int popSelectLoopDepth()

setSelectLoopDepth

public void setSelectLoopDepth(int depth)

generateId

public int generateId()

clearUnique

public void clearUnique()

printHeader

protected void printHeader()
                    throws java.io.IOException
Prints the generated header.

Throws:
java.io.IOException

generateChild

protected void generateChild(org.w3c.dom.Node child)
                      throws java.lang.Exception
Throws:
java.lang.Exception

createChild

protected XslNode createChild(XslNode parent,
                              org.w3c.dom.Node childNode)
                       throws java.lang.Exception
Throws:
java.lang.Exception

createChild

protected XslNode createChild(org.w3c.dom.Node child)
                       throws java.lang.Exception
Throws:
java.lang.Exception

printTemplate

protected void printTemplate(org.w3c.dom.Element absNode,
                             java.lang.String name,
                             java.lang.String pattern,
                             java.lang.String mode,
                             double priority)
                      throws java.lang.Exception
Generates code for a template

Parameters:
absNode - the XSL node for the emplace
name - the template name
pattern - the pattern string
mode - the template's mode
priority - the template's priority
Throws:
java.lang.Exception

addMacro

public void addMacro(java.lang.String name,
                     java.lang.String functionName)

hasMacro

public boolean hasMacro(java.lang.String name)

createTemplatePattern

public java.lang.String createTemplatePattern(java.lang.String name,
                                              AbstractPattern match,
                                              java.lang.String mode,
                                              double priority)
                                       throws java.lang.Exception
Generates the pattern for a matching pattern

Parameters:
name - the mangled name of the function
match - the XPath match pattern
mode - the template mode
priority - the template priority
node - the source XML node from the XSL file
Returns:
the name of the function
Throws:
java.lang.Exception

startDisableEscaping

protected void startDisableEscaping()
                             throws java.io.IOException
Throws:
java.io.IOException

endDisableEscaping

protected void endDisableEscaping()
                           throws java.io.IOException
Throws:
java.io.IOException

writeText

protected void writeText(java.lang.String text)
                  throws java.lang.Exception
Creates Java code to print plain text.

Throws:
java.lang.Exception

printElement

protected void printElement(org.w3c.dom.Node node)
                     throws java.lang.Exception
Throws:
java.lang.Exception

printLocation

public void printLocation(java.lang.String systemId,
                          java.lang.String filename,
                          int line)
                   throws java.lang.Exception
Prints a command to set the current file and line into the generated document.

Parameters:
filename - the source filename
line - the source line number.
Throws:
java.lang.Exception

pushCall

protected void pushCall()
                 throws java.io.IOException
Throws:
java.io.IOException

pushCallDepth

public int pushCallDepth()

popCallDepth

public int popCallDepth()

getCallDepth

public int getCallDepth()

popCall

protected void popCall()
                throws java.io.IOException
Throws:
java.io.IOException

printApplyTemplates

protected void printApplyTemplates(AbstractPattern select,
                                   java.lang.String mode,
                                   Sort[] sort)
                            throws java.lang.Exception
Prints code for xsl:apply-templates

Parameters:
select - the select pattern
mode - the template mode
sort - the sort expressions
Throws:
java.lang.Exception

addSort

public int addSort(Sort[] sort)

printApplyImports

protected void printApplyImports(java.lang.String mode,
                                 int min,
                                 int max)
                          throws java.lang.Exception
Prints code to implement xsl:apply-imports

Parameters:
mode - the mode of the imported files
min - the min importance
max - the max importance
Throws:
java.lang.Exception

printCallTemplate

protected void printCallTemplate(java.lang.String name,
                                 java.lang.String mode)
                          throws java.lang.Exception
Throws:
java.lang.Exception

getMacroName

public java.lang.String getMacroName(java.lang.String name)

printParam

protected void printParam(java.lang.String name,
                          java.lang.String value,
                          org.w3c.dom.Element elt)
                   throws java.lang.Exception
Prints the value for a parameter.

Throws:
java.lang.Exception

printParam

protected void printParam(java.lang.String name,
                          java.lang.Object value)
                   throws java.lang.Exception
Throws:
java.lang.Exception

printParamVariable

protected void printParamVariable(java.lang.String name,
                                  Expr value)
                           throws java.lang.Exception
Prints code to add the value of an expression as a parameter.

Throws:
java.lang.Exception

printParamVariable

protected void printParamVariable(java.lang.String name,
                                  org.w3c.dom.Element value)
                           throws java.lang.Exception
Throws:
java.lang.Exception

printVariable

protected void printVariable(java.lang.String name,
                             java.lang.Object value)
                      throws java.lang.Exception
Throws:
java.lang.Exception

printAssign

protected void printAssign(java.lang.String name,
                           java.lang.Object value)
                    throws java.lang.Exception
Throws:
java.lang.Exception

printPopScope

protected void printPopScope(int count)
                      throws java.lang.Exception
Throws:
java.lang.Exception

printCopyOf

protected void printCopyOf(java.lang.String select,
                           org.w3c.dom.Element elt)
                    throws java.lang.Exception
Throws:
java.lang.Exception

printSelectValue

protected void printSelectValue(java.lang.String select,
                                org.w3c.dom.Element elt)
                         throws java.lang.Exception
Throws:
java.lang.Exception

printForEach

protected void printForEach(org.w3c.dom.Element element,
                            java.lang.String select)
                     throws java.lang.Exception
Throws:
java.lang.Exception

printForEach

protected void printForEach(org.w3c.dom.Element element,
                            java.lang.String select,
                            Sort[] sort)
                     throws java.lang.Exception
Prints code for xsl:for-each when the for-each has any xsl:sort.

Throws:
java.lang.Exception

getCurrentPosition

public java.lang.String getCurrentPosition()

setCurrentPosition

public void setCurrentPosition(java.lang.String pos)

getNodeListContext

public AbstractPattern getNodeListContext()

setNodeListContext

public void setNodeListContext(AbstractPattern context)

printIf

protected void printIf(org.w3c.dom.Element element,
                       Expr test)
                throws java.lang.Exception
Throws:
java.lang.Exception

printChoose

protected void printChoose(org.w3c.dom.Element element,
                           Expr expr,
                           boolean first)
                    throws java.lang.Exception
Throws:
java.lang.Exception

printOtherwise

protected void printOtherwise(org.w3c.dom.Element element,
                              boolean first)
                       throws java.lang.Exception
Throws:
java.lang.Exception

addFormat

public int addFormat(XslNumberFormat format)

printCopy

protected void printCopy(org.w3c.dom.Element element)
                  throws java.lang.Exception
Throws:
java.lang.Exception

printResultDocument

protected void printResultDocument(org.w3c.dom.Element element,
                                   java.lang.String href,
                                   java.lang.String format)
                            throws java.lang.Exception
Throws:
java.lang.Exception

printElement

protected void printElement(org.w3c.dom.Element element,
                            java.lang.String name)
                     throws java.lang.Exception
Throws:
java.lang.Exception

printElement

protected void printElement(org.w3c.dom.Element element,
                            java.lang.String name,
                            java.lang.String namespace)
                     throws java.lang.Exception
Throws:
java.lang.Exception

getAttributeSet

public java.util.HashMap<java.lang.String,java.lang.String> getAttributeSet(java.lang.String name)
Returns the named attribute set.


getAttributeSetList

public java.util.ArrayList<XslAttribute> getAttributeSetList(java.lang.String name)
Returns the named attribute set.


printAttribute

protected void printAttribute(org.w3c.dom.Element element,
                              java.lang.String name)
                       throws java.lang.Exception
Prints an xsl:attribute

Throws:
java.lang.Exception

printNamespace

public void printNamespace(NamespaceContext namespace)
                    throws java.lang.Exception
Throws:
java.lang.Exception

addNamespace

public int addNamespace(NamespaceContext namespace)
                 throws java.lang.Exception
Throws:
java.lang.Exception

printAttribute

protected void printAttribute(org.w3c.dom.Element element,
                              java.lang.String name,
                              java.lang.String namespace)
                       throws java.lang.Exception
Throws:
java.lang.Exception

printPi

protected void printPi(org.w3c.dom.Element element)
                throws java.lang.Exception
Throws:
java.lang.Exception

printComment

protected void printComment(org.w3c.dom.Element element)
                     throws java.lang.Exception
Throws:
java.lang.Exception

printError

protected void printError(java.lang.String msg)
                   throws java.lang.Exception
Throws:
java.lang.Exception

printMessage

protected void printMessage(org.w3c.dom.Element msg)
                     throws java.lang.Exception
Throws:
java.lang.Exception

printExpression

protected void printExpression(org.w3c.dom.Element element)
                        throws java.lang.Exception
Prints code to implement the xtp:expression tag, i.e. print the value of the Java expression.

Throws:
java.lang.Exception

printScriptlet

protected void printScriptlet(org.w3c.dom.Element element)
                       throws java.lang.Exception
Throws:
java.lang.Exception

printWhile

protected void printWhile(org.w3c.dom.Element element,
                          Expr test)
                   throws java.lang.Exception
Throws:
java.lang.Exception

printDeclaration

protected void printDeclaration(org.w3c.dom.Element element)
                         throws java.lang.Exception
Throws:
java.lang.Exception

printCacheDepends

protected void printCacheDepends(java.lang.String name)
                          throws java.lang.Exception
Throws:
java.lang.Exception

getElement

public java.lang.String getElement()

pushLoop

public void pushLoop()

popLoop

public void popLoop()

getEnv

public java.lang.String getEnv()

printExprTest

public void printExprTest(int exprId,
                          java.lang.String element)
                   throws java.lang.Exception
Throws:
java.lang.Exception

addExpr

public int addExpr(Expr expr)
            throws XslParseException
Adds an expression constant returning its index.

Parameters:
expr - the expression to add.
Returns:
the index into the runtime expression array
Throws:
XslParseException

addExpr

public int addExpr(java.lang.String exprString)
            throws XslParseException
Adds an expression constant returning its index.

Parameters:
exprString - the expression to add.
Returns:
the index into the runtime expression array
Throws:
XslParseException

addSelect

public int addSelect(AbstractPattern select)
              throws java.io.IOException,
                     XslParseException
Adds a select pattern returning its index.

Parameters:
select - the select pattern to add.
Returns:
the index into the runtime expression array
Throws:
java.io.IOException
XslParseException

addSelect

public int addSelect(java.lang.String selectString)
              throws java.io.IOException,
                     XslParseException
Adds a select pattern, returning its index.

Parameters:
selectString - the expression to add.
Returns:
the index into the runtime select pattern array
Throws:
java.io.IOException
XslParseException

addMatch

public int addMatch(AbstractPattern pattern)
             throws XslParseException
Adds a match pattern, returning its index.

Parameters:
pattern - the expression to add.
Returns:
the index into the runtime expression array
Throws:
XslParseException

completeGenerate

protected StylesheetImpl completeGenerate(java.util.ArrayList<XslNode> inits,
                                          java.util.ArrayList globals)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

printInitVars

protected void printInitVars(java.util.ArrayList<XslNode> inits)
                      throws java.lang.Exception
Generate code executed for all transformations.

printInit

protected void printInit()
                  throws java.lang.Exception
Throws:
java.lang.Exception

printString

protected void printString(java.lang.String str)
                    throws java.io.IOException
Prints the contents of a string, taking care of escapes.

Throws:
java.io.IOException

getModeName

public java.lang.String getModeName(java.lang.String mode)
Returns the name of the applyNode method.

Parameters:
mode - the template's mode.

addMode

public void addMode(java.lang.String mode)

addStylesheet

public int addStylesheet(java.lang.String filename)

toJavaIdentifier

public java.lang.String toJavaIdentifier(java.lang.String name)
Converts a string to a Java identifier, encoding unknown characters as "_"


close

public void close()
           throws java.io.IOException
Close call when an error occurs.

Throws:
java.io.IOException

setErrorPage

public void setErrorPage(java.lang.String errorPage)

setStyleScript

public void setStyleScript(boolean stylescript)

addImport

public void addImport(java.lang.String pkg)
Adds a Java import to the generated stylesheet.


setContentType

public void setContentType(java.lang.String type)

getMinImportance

public int getMinImportance()

getMaxImportance

public int getMaxImportance()

getNamespace

public NamespaceContext getNamespace()

addLocale

public void addLocale(java.lang.String name,
                      java.text.DecimalFormatSymbols format)

uniqueId

public int uniqueId()
Generates a uniqueId


generate

public StylesheetImpl generate(org.w3c.dom.Node node)
                        throws java.lang.Exception
Starts the generation from the top of the document.

Parameters:
xsl - the stylesheet document.
Throws:
java.lang.Exception

addImportList

public void addImportList(java.lang.String value)
                   throws XslParseException
Throws:
XslParseException

addExcludedNamespace

public void addExcludedNamespace(java.lang.String ns)

addInit

public void addInit(XslNode node)

addGlobalParameter

public void addGlobalParameter(java.lang.String param)

generateImport

public XslNode generateImport(java.lang.String href)
                       throws java.lang.Exception
Throws:
java.lang.Exception

generateInclude

public void generateInclude(XslNode parent,
                            java.lang.String href)
                     throws java.lang.Exception
Throws:
java.lang.Exception

addKey

public void addKey(java.lang.String name,
                   AbstractPattern match,
                   Expr use)

addNamespaceAlias

public void addNamespaceAlias(java.lang.String stylesheetPrefix,
                              java.lang.String resultPrefix)

addNamespaceAlias

public void addNamespaceAlias(java.lang.String namespace,
                              java.lang.String[] result)

getNamespaceAlias

public java.lang.String[] getNamespaceAlias(java.lang.String namespace)

addAttributeSet

public void addAttributeSet(java.lang.String name,
                            XslAttributeSet attributeSet)
Scans through the stylesheet, grabbing the attribute set definitions.

Parameters:
element - the current node

setDisableOutputEscaping

public void setDisableOutputEscaping(boolean disable)

getDisableOutputEscaping

public boolean getDisableOutputEscaping()

setOutputAttribute

public void setOutputAttribute(java.lang.String name,
                               java.lang.String value)

addStripSpace

public void addStripSpace(java.lang.String elements)

addPreserveSpace

public void addPreserveSpace(java.lang.String elements)

generateChildren

protected void generateChildren(org.w3c.dom.Node node)
                         throws java.lang.Exception
Throws:
java.lang.Exception

generateChildImpl

public void generateChildImpl(org.w3c.dom.Node child)
                       throws java.lang.Exception
Throws:
java.lang.Exception

generateChild

public void generateChild(org.w3c.dom.Node child,
                          int code)
                   throws java.lang.Exception
Throws:
java.lang.Exception

setLocation

public void setLocation(java.lang.String systemId,
                        java.lang.String filename,
                        int line)
                 throws XslParseException,
                        java.io.IOException
Throws:
XslParseException
java.io.IOException

printCopyElement

protected void printCopyElement(org.w3c.dom.Element element)
                         throws java.lang.Exception
Throws:
java.lang.Exception

getImportance

public int getImportance()

setMinImportance

public void setMinImportance(int importance)

incrementImportance

public void incrementImportance()

parseMatch

public AbstractPattern parseMatch(java.lang.String pattern)
                           throws XslParseException,
                                  java.io.IOException
Throws:
XslParseException
java.io.IOException

parseSelect

public AbstractPattern parseSelect(java.lang.String pattern)
                            throws java.io.IOException,
                                   XslParseException
Throws:
java.io.IOException
XslParseException

parseSelect

protected AbstractPattern parseSelect(java.lang.String pattern,
                                      org.w3c.dom.Node node)
                               throws java.io.IOException,
                                      XslParseException
Throws:
java.io.IOException
XslParseException

parseExpr

public Expr parseExpr(java.lang.String pattern)
               throws XslParseException
Throws:
XslParseException

getXslLocal

protected java.lang.String getXslLocal(org.w3c.dom.Node node)
Returns the local name of an XSL element. Non-XSL elements return null. So xsl:copy will return "copy", while "foo:bar" returns null.

Parameters:
node - the XSL source node
Returns:
the local part of the XSL name.

getXtpLocal

protected java.lang.String getXtpLocal(org.w3c.dom.Node node)

addNamespace

protected NamespaceContext addNamespace(org.w3c.dom.Element elt)
Adds the namespaces in the element to the current NamespaceContext. The XPath pattern parsing uses NamespaceContext to associate the right context with element patterns.

Parameters:
elt - the XSL element being processed.
Returns:
the old namespace context