![]() |
![]() |
![]() |
![]() |
Template Operations
A template is a text file which has some text abbreviated in a known way. For example, the following HTML code
might appear several times in a document. Rather than typing this multiple times, a unique name might be substituted, for example "$D". Its value is as indicated above. The TemplateProcessor class is provided to read in text and replace names with values. The "names" can be any text. Matches are case sensitive (so $d would not equal $D) but do not need to be complete words. Once a name has been replaced with a value, that value will not itself be searched, so if "$m" is replaced with "men", and "men" is replaced with "men and women", "$m" will not end up being replaced by "men and women".
The options in the sourcerer include
- Create a new TemplateProcessor object...
- Add Name/value pairs to a TemplateProcessor...
- Get processed text from a TemplateProcessor
Create a new TemplateProcessor object... sets up a new TemplateProcessor object. An input String or text file is needed.
Add Name/value pairs to a TemplateProcesor... adds a name/value pair to an existing templateProcessor.
Get processed text from a TemplateProcessor returns a string which is equal to the substituted text from the templateProcessor.
Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |
![]() |
![]() |
![]() |
![]() |