sunlabs.brazil.sunlabs
Class SourceTemplate
java.lang.Object
sunlabs.brazil.template.Template
sunlabs.brazil.sunlabs.SourceTemplate
- All Implemented Interfaces:
- TemplateInterface
public class SourceTemplate
- extends Template
Template class for incorporating the content of a local file into
the current document.
<source src=file
[encoding=enc name=property eval=true|false reprocess=true|false]
>
Attributes:
- src
- Where to find the document to source. Unless starting with
"/", it is assumed to be relative to the document root.
- eval
- If true, all ${...} are evaluated as the file is read in from storage.
- encoding
- Specifies the character encoding to use. If not specified
or invalid, the default encoding is used.
- name
- If set, the content is placed in the named variable instead
of being inserted in-line.
- reprocess
- If true, and
name
is not set (e.g. the content is inserted
in-line, then the content will be run through the normal template
processing before being inserted into the current document.
- Examples:
-
The form:
<source src=xml.tmpl eval=true>
can be used to read in XML templates (or template fragments) that
contain ${...} constructs that get filled in as the template
is read.
The form:
<source src=section1.html reprocess=true>
can be used as a convenient way to break a single logical file into
separate sections. (Note: this isn't currently implemented in a very
efficient way.
- Author:
- Stephen Uhler
SCCS: @(#) SourceTemplate.java 1.5 05/06/09 11:18:38
Fields inherited from class sunlabs.brazil.template.Template |
debug |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SourceTemplate
public SourceTemplate()
tag_source
public void tag_source(RewriteContext hr)