XML Templates

The Wolfram Language has a rich mechanism for defining and applying XML templates. These templates can be used in HTML and other forms of XML. The XML tagging system supported by the Wolfram Language is set up to be compatible with XML standards and transformation tools.

(RefLink[XMLTemplate, paclet:ref/XMLTemplate]) — set up an XML template

(RefLink[TemplateApply, paclet:ref/TemplateApply]) — apply an XML template

XML Tags

(RefLink[<wolfram:slot>, paclet:ref/TemplateSlot]) — slot to be filled when the template is applied ((RefLink[TemplateSlot, paclet:ref/TemplateSlot]))

(RefLink[<wolfram:expr>, paclet:ref/TemplateExpression]) — expression to be evaluated ((RefLink[TemplateExpression, paclet:ref/TemplateExpression]))

(RefLink[<wolfram:if>, paclet:ref/TemplateIf]) — content to include if a test is true ((RefLink[TemplateIf, paclet:ref/TemplateIf]))

<wolfram:which> — content chosen using nested if-else clauses

(RefLink[<wolfram:sequence>, paclet:ref/TemplateSequence]) — block of content to repeat ((RefLink[TemplateSequence, paclet:ref/TemplateSequence]))

(RefLink[<wolfram:with>, paclet:ref/TemplateWith]) — replacements to be used when the template is applied ((RefLink[TemplateWith, paclet:ref/TemplateWith]))

<wolfram:template> — nested template, potentially with different options

<wolfram:get> — content to get from a file or URL

<wolfram:comment> — comment to be ignored

<wolfram:verbatim> — verbatim XML to include

XML Attributes

values — list or association to iterate over with <wolfram:sequence>

separator — separator between blocks in <wolfram:sequence>

test — test to use in <wolfram:if>

path — path to use in <wolfram:get>

inserter, combiner — settings for (RefLink[InsertionFunction, paclet:ref/InsertionFunction]), (RefLink[CombinerFunction, paclet:ref/CombinerFunction])