|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.ejen.EjenChildNode
|
+--org.ejen.EjenStylesheetNode
|
+--org.ejen.EjenTemplateNode
Template node class.
A template node uses the current in memory DOM tree to create resulting text files (XML, HTML, source code, ...).
| Usage (ant build file) |
|---|
|
Parent nodes:
| Field Summary | |
protected String |
_filepattern
|
protected String |
_foreach
|
| Fields inherited from class org.ejen.EjenStylesheetNode |
_childNodes, _file |
| Fields inherited from class org.ejen.EjenChildNode |
_messageIndent |
| Fields inherited from interface org.ejen.EjenConstants |
CTX_DOM_SOURCE, CTX_STYLESHEET_HANDLER, CTX_STYLESHEET_ROOT, CTX_TRANSFORMER_FACTORY_IMPL, CTX_TRANSFORMER_IMPL, DEFAULT_XML_DATA, DEFAULT_XML_DATA_ENCODING, DEFAULT_XSL_DATA, LOG_INDENT_STR1, LOG_INDENT_STR2, MSG_DEBUG, MSG_ERR, MSG_INFO, MSG_VERBOSE, MSG_WARN, STATE_AFTER_PROCESS, STATE_BEFORE_PROCESS, STATE_CHECK, STATE_IDLE, STATE_PROCESS, STATES |
| Constructor Summary | |
EjenTemplateNode()
|
|
| Method Summary | |
Properties |
getAttributes()
Returns all non null attributes of this EjenTemplateNode. |
String |
nodeName()
Returns the name of this EjenTemplateNode (always "template"). |
void |
process()
Executes this EjenTemplateNode. |
void |
setFilepattern(String filepattern)
[optional/AVT] - sets the filepattern attribute. |
void |
setForeach(String foreach)
[optional/AVT] - sets the foreach attribute. |
| Methods inherited from class org.ejen.EjenStylesheetNode |
afterProcess, beforeProcess, check, createImport, createInclude, createParam, getChildren, setFile |
| Methods inherited from class org.ejen.EjenChildNode |
cloneContext, evaluateAVT, evaluateAVT, getFromContext, getFromContext, getFromGlobalContext, getListener, getState, idle, popContext, pushContext, putInContext, putInGlobalContext, sendMessageEvent, sendMessageEvent, sendStateEvent, sendXSLMessageEvent, sendXSLMessageEvent, setListener, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected String _foreach
protected String _filepattern
| Constructor Detail |
public EjenTemplateNode()
| Method Detail |
public String nodeName()
nodeName in class EjenChildNodepublic Properties getAttributes()
getAttributes in class EjenStylesheetNodepublic void setForeach(String foreach)
Suppose you have the following DOM tree in memory:
|
|
|
If this attribute is used, a parameter whose name is "root" and value is the root
node of the current DOM tree is always and automaticaly passed to the template
stylesheet (you may have the line "<xsl:param name"root"/>" in
the stylesheet).
See the filepattern for output file naming.
foreach - foreach String (default is null, meaning "apply this template
stylesheet to the entire current DOM tree").public void setFilepattern(String filepattern)
Suppose what is supposed here. You want to
generate text files whose names are: Name1.txt, Name2.txt,
Name3.txt... Then, you can use this filepattern: "{.}.txt".
If this basic file output naming mechanism is not sufficient, you may still use the Xalan Redirect extension.
filepattern - filepattern String (default is null, meaning "let the
template do whatever it wants").public void process()
process in class EjenStylesheetNodeEjenException - if something goes wrong...
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||