Input XSLT Output

apply-templates (“/*”)

Same as EG103, but selecting “/*” for top element.

This time the context is the top Element, so Test4 now selects the Attributes of the “Document” Element.

Another difference in Test2 is the lack of line ending whitespace in the output for the <Id>, <Type>, <Name> and <Description> Elements (compared to EG103).

This is because Test2 selects for child::* Elements.

Back in EG103 the template matched the XML Document, so the (only) child element there was the <Document> Element.

Therefore the select returned that Element (and that Element only), and that included all that Element's whitespace!

Specifically, it included the whitespace around those top Elements, and that whitespace includes the line endings for the Elements.

Here in EG104, the template matches