Input XSLT Output

Matching an Element

Now we explore the possibilities of sub templates!

In this example, a simple single apply-templates selects for an <Object> Element as an immediate child of a <ListOfObject> Element. (Keep in mind the context of the main template is the top Element, and so the <ListOfObject> element, as an immediate child, can be referred to by name.)

The sub template has a match that matches <Object> Elements.

Note that the path used to select the node set is not required to match it. Only the node name is necessary in the match Attribute.