| java.lang.Object com.xoetrope.template.XTemplateProcessor com.xoetrope.template.XXmlTemplateProcessor
XXmlTemplateProcessor | public class XXmlTemplateProcessor extends XTemplateProcessor (Code) | | A template processor for parameterized XML files.
Individual elements can be
excludes/included in the copy of the template file by adding the 'te_include'
attribute to those elements. The attribute value is then used to query the
template engine's includes method. The method's return value dictates whether
or not the element is included.
A <Repeat> element can be included so that elements can be
repeated. The element is repeated while the while attribute
evaluates to true . The same evaluation mechansim as is used
within XUI's page is employed and the XTemplateEngine 's
subclasses can implement the callback methods. As each item is included the
loop counter is processed and this value can be used with expressoions as the
value {N} . Each attribute is evaluated so that the necessary
substitutions can be made. This a field name by be coded as
name="addressEdit{N}" such that the name is different for each
element included.
Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
the GNU Public License (GPL), please see license.txt for more details. If
you make commercial use of this software you must purchase a commercial
license from Xoetrope.
$Revision: 1.6 $
|
copyResources | protected boolean copyResources(XmlElement xe)(Code) | | Attempt to copy the resources specified in XML template
Parameters: xe - the element being processed true if the processing completed successfully, otherwise false is returned |
excludeElements | protected boolean excludeElements(XmlElement xe)(Code) | | Exclude those elements that are marked as being optional.
Calls back to the isIncluded method of the template engine
Parameters: xe - the element being processed true if the processing completed successfully, otherwise false is returned |
includeElements | protected boolean includeElements(XmlElement xe)(Code) | | Include the xml fragements referenced by the include elements
Parameters: xe - the element being processed true if the processing completed successfully, otherwise false is returned |
insertAttribute | protected boolean insertAttribute(XmlElement xe)(Code) | | Sustitute any content, field values etc described in the template
Parameters: xe - the element being processed true if the processing completed successfully, otherwise false is returned |
loadFile | protected boolean loadFile()(Code) | | Read the XML template
true if the processing completed successfully, otherwise false is returned |
process | public boolean process(String sourceName, String targetName, int processingType)(Code) | | |
repeatElements | protected boolean repeatElements(XmlElement parent, XmlElement xe)(Code) | | Repeat those elements that are within a repeat element.
The while clause of the repeat element is used to determine the number of
times the element is repeated. When done, the repeat element is removed.
Parameters: parent - the parent of the element being processed Parameters: xe - the element being processed true if the processing completed successfully, otherwise false is returned |
saveFile | protected boolean saveFile()(Code) | | Save the XML template
true if the processing completed successfully, otherwise false is returned |
|
|