Tmplz Tags |
Extra Tags: TagWithThe TagWith tag allows a template author to change the delimiter characters for Tmplz tags. When the parser encounters a TagWith tag, it switches to the specified syntax for all tags thereafter. A file can have multiple TagWith's. Example 1[$TagWith {{ }}] {{Slot X1}} {{TagWith "{$" "}"}} {$Slot X2} First we changed delimiters from the default Example 2[$TagWith javascript]
This sets the delimiters to
Example 3~~TagWith javascript /*Slot Bar*/ ~~TagWith {{,}} {{Slot Bar}} Here we are using a somewhat atypical syntax, but it works no matter what the current tag delimiters are: Start with
This can be helpful in a situation where one has no guarantee about the default delimiters, such as when writing reuseable template libraries (also refer to "Setting Defaults" below). Additional NotesDelimiters Don't Have to be WeirdIf " Setting defaultsInstead of typing TagWith into every template, the default tag delimiters can be set by a Java programmer using TemplateManager.setTagDelimiters(). XMLTmplz does not have any way to specify XML-compliant tagging, e.g.: <Section Foo> blar blar blar </Section> <Slot Bar/> Next page: Trim |