Altova StyleVision 2024 Enterprise Edition

The rest-of-contents placeholder applies templates to all the remaining child elements of the element for which the template has been created. As an example consider the following:

 

An element parent has 4 child elements, child1 to child4.

In the template for element parent, some processing has been explicitly defined for the child1 and child4 child elements.

 

This results in only the child1 and child4 child elements being processed. The elements child2 and child3 will not be processed. Now, if the rest-of-contents placeholder is inserted within the template for parent, then, not only will child1 and child4 be processed using the explicitly defined processing rules in the template. Additionally, templates will be applied for the child2 and child3 child elements. If global templates for these are defined then the global templates will be used. Otherwise the built-in default templates (for element, attribute, and text nodes) will be applied.

 

Important: It is important to note what nodes are selected for rest-of-contents.

 

As described with the example above, all child element nodes and child text nodes are selected by the rest-of-contents placeholder. (Even invalid child nodes in the XML document will be processed.)

Attribute nodes are not selected; they are not child nodes, that is, they are not on the child axis of XPath.

If a global template of a child element is used in the parent template, then the child element does not count as having been used locally. As a result, the rest-of-contents placeholder will also select such child elements. However, if a global template of a child element is "copied locally", then this usage counts as local usage, and the child element will not be selected by the rest-of-contents placeholder.

 

Note:You can create an empty template rule by deleting the (content) placeholder of a node. An empty template rule is useful if you wish to define that some node not be processed, i.e. produce no output.

 

 

© 2017-2023 Altova GmbH