XMLTemplate

XMLTemplate["string"]
yields a TemplateObject that represents an XML template to be applied using functions like TemplateApply.

XMLTemplate[src]
uses a , , or CloudObject as the source for the XML template.

XMLTemplate[form,args]
yields a TemplateObject with arguments, suitable for cloud deployment or other evaluation.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Apply an XML template with slots named and :

In[1]:=
Click for copyable input
Out[1]=

An equivalent form using TemplateApply:

In[2]:=
Click for copyable input
Out[2]=

XMLTemplate supports the same syntax of StringTemplate; expressions inside are evaluated when the template is applied:

In[1]:=
Click for copyable input
Out[1]=

Include a template slot as well as an expression in the template string:

In[2]:=
Click for copyable input
Out[2]=

An equivalent syntax using XML tags:

In[3]:=
Click for copyable input
Out[3]=

String template syntax is useful when you need to inject data inside XML attributes:

In[4]:=
Click for copyable input
Out[4]=
Introduced in 2014
(10.0)
Translate this page: