com.caucho.xsl
Class StylesheetImpl

java.lang.Object
  |
  +--com.caucho.xsl.Stylesheet
        |
        +--com.caucho.xsl.StylesheetImpl
Direct Known Subclasses:
JavaScriptStylesheet, JavaStylesheet

public class StylesheetImpl
extends Stylesheet

Implementation base class for stylesheets. It is made public only because generated Java and JavaScript classes need to access these routines.


Inner classes inherited from class com.caucho.xsl.Stylesheet
Stylesheet.Depend
 
Field Summary
protected  boolean defaultDisableEscaping
           
protected  java.util.HashMap templates
           
 char[] text
           
 
Fields inherited from class com.caucho.xsl.Stylesheet
cacheDepends, errorPage
 
Constructor Summary
StylesheetImpl()
           
 
Method Summary
protected  void _xsl_init(XslWriter out, Node context, Env env)
           
protected  void addFunction(java.lang.String name, XPathFun fun)
           
 void anyNumber(XslWriter out, Node node, Env env, Pattern countPattern, Pattern fromPattern, XslNumberFormat format)
           
protected  void applyNode(XslWriter out, Node node, Env env, java.lang.String mode, int min, int max)
           
protected  void applyNodeDefault(XslWriter out, Node node, Env env, java.lang.String mode)
           
 void exprNumber(XslWriter out, Node node, Env env, Expr expr, XslNumberFormat format)
           
 java.lang.String getNodeValue(Node node)
           
 Path getPath()
           
protected  Template getTemplate(Node node, Env env, java.lang.String mode, int min, int max)
          Gets a template.
 void init(Path path)
           
 void init(XslWriter out, java.util.HashMap env)
           
 void multiNumber(XslWriter out, Node node, Env env, Pattern countPattern, Pattern fromPattern, XslNumberFormat format)
           
 void printValue(XslWriter out, Node node)
           
protected  void setSpaces(java.util.HashMap preserve, java.util.HashMap strip)
           
 void singleNumber(XslWriter out, Node node, Env env, Pattern countPattern, Pattern fromPattern, XslNumberFormat format)
           
 Document transform(Node xml, java.util.HashMap env, Path pwd, PageContext page)
          Transforms the XML node to a new XML document based on this stylesheet.
 CacheableDocument transformCacheable(Node xml, java.util.HashMap env, Path pwd, PageContext page)
          Transforms the XML node to a new XML document based on this stylesheet.
 Document xslExecute(XslWriter out, Node xml)
           
protected  java.util.ArrayList xslSort(Node node, Env env, Pattern pattern, Sort[] sortList)
           
 
Methods inherited from class com.caucho.xsl.Stylesheet
addCacheDepend, addDepend, addDepend, getCacheDepends, getContentType, getDepends, getErrorPage, getLastModified, getOutputAttribute, isModified, print, print, setOutputAttribute, transform, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

text

public char[] text

templates

protected java.util.HashMap templates

defaultDisableEscaping

protected boolean defaultDisableEscaping
Constructor Detail

StylesheetImpl

public StylesheetImpl()
Method Detail

getPath

public Path getPath()

setSpaces

protected void setSpaces(java.util.HashMap preserve,
                         java.util.HashMap strip)

addFunction

protected void addFunction(java.lang.String name,
                           XPathFun fun)

transform

public Document transform(Node xml,
                          java.util.HashMap env,
                          Path pwd,
                          PageContext page)
                   throws java.lang.Exception
Description copied from class: Stylesheet
Transforms the XML node to a new XML document based on this stylesheet.

Since Documents are DocumentFragments, calling functions can insert the contents using appendChild.

Overrides:
transform in class Stylesheet
Tags copied from class: Stylesheet
Parameters:
xml - source xml to convert
env - hash map of properties to pass to the stylesheet
pwd - the working directory for the stylesheet
page - the JSP page context for XTP
Returns:
the converted document

transformCacheable

public CacheableDocument transformCacheable(Node xml,
                                            java.util.HashMap env,
                                            Path pwd,
                                            PageContext page)
                                     throws java.lang.Exception
Description copied from class: Stylesheet
Transforms the XML node to a new XML document based on this stylesheet.

The CacheableDocument class lets a caller, like XTP, avoid recomputing the stylesheet when nothing has changed.

Overrides:
transformCacheable in class Stylesheet
Tags copied from class: Stylesheet
Parameters:
xml - source xml to convert
env - hash map of properties to pass to the stylesheet
pwd - the working directory for the stylesheet
page - the JSP page context for XTP
Returns:
a cache wrapper around the converted document

init

public void init(Path path)
          throws java.lang.Exception
Overrides:
init in class Stylesheet

init

public void init(XslWriter out,
                 java.util.HashMap env)
          throws java.lang.Exception

xslExecute

public Document xslExecute(XslWriter out,
                           Node xml)
                    throws java.lang.Exception

_xsl_init

protected void _xsl_init(XslWriter out,
                         Node context,
                         Env env)
                  throws java.lang.Exception

applyNode

protected void applyNode(XslWriter out,
                         Node node,
                         Env env,
                         java.lang.String mode,
                         int min,
                         int max)
                  throws java.lang.Exception

getTemplate

protected Template getTemplate(Node node,
                               Env env,
                               java.lang.String mode,
                               int min,
                               int max)
Gets a template. Only those templates with importance between min and max are considered. For apply-templates, min = 0, and max = Infinity,
Parameters:
min - minimum allowed importance
max - maximum allowed importance

applyNodeDefault

protected void applyNodeDefault(XslWriter out,
                                Node node,
                                Env env,
                                java.lang.String mode)
                         throws java.lang.Exception

printValue

public void printValue(XslWriter out,
                       Node node)
                throws java.io.IOException

getNodeValue

public java.lang.String getNodeValue(Node node)

xslSort

protected java.util.ArrayList xslSort(Node node,
                                      Env env,
                                      Pattern pattern,
                                      Sort[] sortList)
                               throws java.lang.Exception

singleNumber

public void singleNumber(XslWriter out,
                         Node node,
                         Env env,
                         Pattern countPattern,
                         Pattern fromPattern,
                         XslNumberFormat format)
                  throws java.lang.Exception

multiNumber

public void multiNumber(XslWriter out,
                        Node node,
                        Env env,
                        Pattern countPattern,
                        Pattern fromPattern,
                        XslNumberFormat format)
                 throws java.lang.Exception

anyNumber

public void anyNumber(XslWriter out,
                      Node node,
                      Env env,
                      Pattern countPattern,
                      Pattern fromPattern,
                      XslNumberFormat format)
               throws java.lang.Exception

exprNumber

public void exprNumber(XslWriter out,
                       Node node,
                       Env env,
                       Expr expr,
                       XslNumberFormat format)
                throws java.lang.Exception