| java.lang.Object com.caucho.xsl.Generator
All known Subclasses: com.caucho.xsl.JavaGenerator,
Generator | abstract class Generator (Code) | | Base class for generating code from an XSL tree. JavaGenerator and
JavaScriptGenerator extend this class for language-specific code
generation.
|
Field Summary | |
final protected static L10N | L | final public static String | XSLNS | final public static String | XTPNS | HashMap<String, XslAttributeSet> | _attributeSets | Path | _baseURL | protected ArrayList<String> | _cacheDepends | Path | _context | boolean | _defaultCacheable | protected ArrayList<Path> | _depends | protected int | _destLine | protected Document | _doc | protected String | _encoding | protected String | _errorPage | protected HashMap<String, String> | _excludedNamespaces | String | _filename | HashMap<String, Document> | _files | protected FormatNumberFun | _formatNumberFun | protected ArrayList | _globalActions | protected ArrayList<String> | _globalParameters | boolean | _hasSession | int | _importance | protected ArrayList<String> | _imports | boolean | _isCacheable | protected boolean | _isRawText | protected boolean | _isSpecial | protected boolean | _isStyleScript | protected KeyFun | _keyFun | int | _line | boolean | _lineContent | protected LineMap | _lineMap | int | _lineWs | int | _loopDepth | HashMap<String, String> | _macros | int | _minImportance | HashMap<String, String> | _names | protected NamespaceContext | _namespace | protected HashMap<String, String[]> | _namespaceAliases | protected AbstractPattern | _nodeListContext | HashMap<String, String> | _outputAttributes | protected Path | _path | protected HashMap<String, String> | _preserve | protected CauchoDocument | _qDoc | protected HashMap<String, String> | _strip | String | _systemId | int | _templateCount | HashMap<String, ArrayList<Template>> | _templates | CharBuffer | _text | Path | _topContext | int | _uniqueId | Path | _workPath | protected AbstractStylesheetFactory | _xslGenerator | String | _xslName |
Method Summary | |
public void | addAttributeSet(String name, XslAttributeSet attributeSet) Scans through the stylesheet, grabbing the attribute set
definitions. | void | addDepend(Path depend) | public void | addExcludedNamespace(String ns) | public void | addGlobalParameter(String param) | public void | addImport(String pkg) Adds a Java import to the generated stylesheet. | public void | addImportList(String value) | public void | addInit(XslNode node) | public void | addKey(String name, AbstractPattern match, Expr use) | public void | addLocale(String name, DecimalFormatSymbols format) | protected NamespaceContext | addNamespace(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. | public void | addNamespaceAlias(String stylesheetPrefix, String resultPrefix) | public void | addNamespaceAlias(String namespace, String[] result) | Template | addPattern(AbstractPattern pattern, String mode, double priority, String function, int funId) Adds a new template pattern. | public void | addPreserveSpace(String elements) | public void | addStripSpace(String elements) | public void | close() Close call when an error occurs. | abstract protected StylesheetImpl | completeGenerate(ArrayList<XslNode> inits, ArrayList globals) | abstract protected XslNode | createChild(Node child) | abstract protected XslNode | createChild(XslNode parent, Node child) | abstract protected void | endDisableEscaping() | XslParseException | error(Exception e) | XslParseException | error(Node node, Exception e) | XslParseException | error(String message) | XslParseException | error(Node node, String message) Creates an error message with filename and line number based on
the source node. | public StylesheetImpl | generate(Node node) Starts the generation from the top of the document. | void | generateAttribute(Element element) | protected void | generateChild(Node child) | public void | generateChild(Node child, int code) | public void | generateChildImpl(Node child) | protected void | generateChildren(Node node) | void | generateChoose(Element element) | void | generateElement(Element element) | void | generateForEach(Element element) | void | generateIf(Element element) | public XslNode | generateImport(String href) | void | generateInclude(Element element) Generates code for xsl:include. | public void | generateInclude(XslNode parent, String href) | void | generateKey(Element element) | void | generateLocale(Element element) | void | generateNamespaceAlias(Element element) | void | generateNumber(Element element) | void | generateTemplate(Element element) | void | generateWhile(Element element) | void | generateXslText(Element element) | public boolean | getDisableOutputEscaping() | public int | getImportance() | public int | getMaxImportance() | public int | getMinImportance() | public NamespaceContext | getNamespace() | public String[] | getNamespaceAlias(String namespace) | public AbstractPattern | getNodeListContext() | abstract protected JavaWriter | getOut() | int | getTextLength() | protected String | getXslLocal(Node node) Returns the local name of an XSL element. | protected String | getXtpLocal(Node node) | public void | incrementImportance() | void | init(String filename) | public Expr | parseExpr(String pattern) | public AbstractPattern | parseMatch(String pattern) | public AbstractPattern | parseSelect(String pattern) | protected AbstractPattern | parseSelect(String pattern, Node node) | abstract protected void | popCall() | abstract protected void | printApplyImports(String mode, int min, int max) | abstract protected void | printApplyTemplates(AbstractPattern select, String mode, Sort[] sort) | protected void | printAssign(String name, Object value) | protected void | printAttribute(Element node, String name) | protected void | printAttribute(Element node, String name, String namespace) | protected void | printCacheDepends(String path) | abstract protected void | printCallTemplate(String name, String mode) | protected void | printChoose(Element element, Expr expr, boolean first) | protected void | printComment(Element node) | protected void | printCopy(Element element) | protected void | printCopyElement(Element element) | abstract protected void | printCopyOf(String select, Element element) | protected void | printDeclaration(Element node) | abstract protected void | printElement(Node node) | protected void | printElement(Element element, String name) | protected void | printElement(Element element, String name, String namespace) | protected void | printError(String msg) | protected void | printExpression(Element node) | abstract protected void | printForEach(Element element, String select) | abstract protected void | printForEach(Element element, String select, Sort[] sort) | protected void | printHeader() | protected void | printIf(Element element, Expr expr) | void | printLocation(Node node) Prints location code for the node. | abstract protected void | printLocation(String systemId, String filename, int line) | protected void | printMessage(Element node) | void | printNumber(Expr expr, XslNumberFormat format) | void | printNumber(String level, AbstractPattern countPattern, AbstractPattern fromPattern, XslNumberFormat format) | protected void | printOtherwise(Element element, boolean first) | abstract protected void | printParam(String name, Object value) | abstract protected void | printParam(String name, String value, Element elt) | abstract protected void | printParamVariable(String name, Expr expr) | abstract protected void | printParamVariable(String name, Element elt) | protected void | printPi(Element node) | abstract protected void | printPopScope(int count) | protected void | printResultDocument(Element element, String href, String format) | protected void | printScriptlet(Element node) | abstract protected void | printSelectValue(String select, Element element) | abstract protected void | printTemplate(Element node, String name, String pattern, String mode, double priority) | abstract protected void | printVariable(String name, Object value) | protected void | printWhile(Element element, Expr expr) | abstract protected void | pushCall() | Document | readXsl(Path path) Read in an imported or included XSL file.
Parameters: path - Path to the include files. | Document | readXsl(ReadStream file) Read in an imported or included XSL file.
Parameters: path - Path to the include files. | public void | setContentType(String type) | public void | setDisableOutputEscaping(boolean disable) | public void | setErrorPage(String errorPage) | void | setLocation(Node node) Sets location code for the node. | public void | setLocation(String systemId, String filename, int line) | public void | setMinImportance(int importance) | public void | setOutputAttribute(String name, String value) | void | setPath(Path path) | public void | setStyleScript(boolean stylescript) | void | setWorkPath(Path path) | abstract protected void | startDisableEscaping() | public int | uniqueId() | abstract protected void | writeText(String text) |
L | final protected static L10N L(Code) | | |
_defaultCacheable | boolean _defaultCacheable(Code) | | |
_destLine | protected int _destLine(Code) | | |
_hasSession | boolean _hasSession(Code) | | |
_importance | int _importance(Code) | | |
_isCacheable | boolean _isCacheable(Code) | | |
_isRawText | protected boolean _isRawText(Code) | | |
_isSpecial | protected boolean _isSpecial(Code) | | |
_isStyleScript | protected boolean _isStyleScript(Code) | | |
_lineContent | boolean _lineContent(Code) | | |
_loopDepth | int _loopDepth(Code) | | |
_minImportance | int _minImportance(Code) | | |
_path | protected Path _path(Code) | | |
_templateCount | int _templateCount(Code) | | |
_topContext | Path _topContext(Code) | | |
_workPath | Path _workPath(Code) | | |
addAttributeSet | public void addAttributeSet(String name, XslAttributeSet attributeSet)(Code) | | Scans through the stylesheet, grabbing the attribute set
definitions.
Parameters: element - the current node |
addDepend | void addDepend(Path depend)(Code) | | |
addExcludedNamespace | public void addExcludedNamespace(String ns)(Code) | | |
addGlobalParameter | public void addGlobalParameter(String param)(Code) | | |
addImport | public void addImport(String pkg)(Code) | | Adds a Java import to the generated stylesheet.
|
addNamespace | protected NamespaceContext addNamespace(Element elt)(Code) | | 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. the old namespace context |
addNamespaceAlias | public void addNamespaceAlias(String stylesheetPrefix, String resultPrefix)(Code) | | |
addPattern | Template addPattern(AbstractPattern pattern, String mode, double priority, String function, int funId)(Code) | | Adds a new template pattern.
Parameters: pattern - the match pattern. Parameters: mode - the template mode. Parameters: priority - the template priority. Parameters: function - the associated function name. Parameters: funId - the function id. |
addPreserveSpace | public void addPreserveSpace(String elements)(Code) | | |
addStripSpace | public void addStripSpace(String elements)(Code) | | |
endDisableEscaping | abstract protected void endDisableEscaping() throws Exception(Code) | | |
error | XslParseException error(Node node, String message)(Code) | | Creates an error message with filename and line number based on
the source node.
Parameters: node - XML node of the source XSL. Parameters: message - the error message. |
generate | public StylesheetImpl generate(Node node) throws Exception(Code) | | Starts the generation from the top of the document.
Parameters: xsl - the stylesheet document. |
generateForEach | void generateForEach(Element element) throws Exception(Code) | | Generates code for the xsl:for-each element
|
generateInclude | void generateInclude(Element element) throws Exception(Code) | | Generates code for xsl:include. The included file has the same
importance as the containing file.
|
getDisableOutputEscaping | public boolean getDisableOutputEscaping()(Code) | | |
getImportance | public int getImportance()(Code) | | |
getMaxImportance | public int getMaxImportance()(Code) | | |
getMinImportance | public int getMinImportance()(Code) | | |
getTextLength | int getTextLength()(Code) | | |
getXslLocal | protected String getXslLocal(Node node)(Code) | | 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 the local part of the XSL name. |
incrementImportance | public void incrementImportance()(Code) | | |
printApplyImports | abstract protected void printApplyImports(String mode, int min, int max) throws Exception(Code) | | |
printLocation | void printLocation(Node node) throws Exception(Code) | | Prints location code for the node.
|
printPopScope | abstract protected void printPopScope(int count) throws Exception(Code) | | |
setDisableOutputEscaping | public void setDisableOutputEscaping(boolean disable)(Code) | | |
setErrorPage | public void setErrorPage(String errorPage)(Code) | | |
setLocation | void setLocation(Node node) throws Exception(Code) | | Sets location code for the node.
|
setMinImportance | public void setMinImportance(int importance)(Code) | | |
setPath | void setPath(Path path)(Code) | | |
setStyleScript | public void setStyleScript(boolean stylescript)(Code) | | |
setWorkPath | void setWorkPath(Path path)(Code) | | |
startDisableEscaping | abstract protected void startDisableEscaping() throws Exception(Code) | | |
uniqueId | public int uniqueId()(Code) | | Generates a uniqueId
|
|
|