xfj:apply-local-template

Top Previous Topic Next Topic  Print this topic

This element can be a "child" of xfj:document or xfj:overlay elements. It is recommended for the user to first get more information about the "parent" elements before applying this attribute.

 

If the file referenced by the xfj:external-content of the parent document or overlay is an XML data document, then a template may be assigned to it using the xfj:apply-local-template or xfj:apply-server-template elements.

 

 

       <xfj:apply-local-template id="myURLTemplate" src="url(file_url)" language-id="templateLanguageId" parameters="p1,v1;p2,v2;...;pN,vN;"/>

 

 

The following attributes can be applied to this element:

 

src - points to an URL or a Base64 blob and must be accessible by the server. It can also specify a reference to an existing template in the job, using the template-id() function.
id - can be optional. it is used to provide the user with the ability to reuse the template by referencing it using another xfj:apply-local-template element.
language-id - is used for specifying the language used for XFD translations. Its value must be one of the languages declared in the template.
parameters - specifies the key/value pairs that must be used during the transformation and that are passed to the XSLT engine.

 

To reference a template, the id attribute for the element which will be referenced must set on the xfj:apply-local-template element. In the example above it is named myURLTemplate.

The referencing element will use the template-id() function in its src attribute, with myURLTemplate being its argument:

 

 

       <xfj:apply-local-template src="template-id(myURLTemplate)""/>

 

 

Note:

id attribute values are case sensitive.

 

To specify a server template that will be used together with a specific XML document, the xfj:apply-server-template element must be used.