Input XSLT Output

apply-templates (“/”)

Here we match the XML Document (as with EG101) and use apply-templates with different select expressions:

  1. Apply-Templates with no select.
  2. Apply-Templates selecting child Elements. (child::*)
  3. Apply-Templates selecting Element name. (<descendant::Object>)
  4. Apply-Templates selecting current attributes. (@*)
  5. Apply-Templates selecting pretty much everything. (descendant-or-self::*/@)

Because there are no “sub” templates to match any node sets selected by apply-templates, the translator uses appropriate built-in default templates. The effect of the default templates is to output the Element Text content.

Test4 and Test5 explicitly select for Attributes (“@*”), and the Attribute Text shows up in the output (again curtesy of built-in default templates).

Test4 is null in this example, because Test4 selects “@*”, which selects the Attributes of (just) the children. We matched the XML Document, which has no Element or Attributes, so the select returns null.