This is a minimal possible XSLT transformation. It produces the string value of the source XML document. The output format is text
.
Source XML document:
<t>Hello, World!</t>
XSLT transformation:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
</xsl:stylesheet>
Result of applying the transformation on the source XML document specified above:
Hello, World!
Do note:
No <xsl:template>
declaration is used.
The wanted type of output is specified in the <xsl:output>
declaration, as the value of its method attribute.
When there are no matching templates the XSLT processor, following the rules of the XSLT processing model, applies the standard XSLT built-in templates and this results in copying to the output of the concatenation of all text nodes in document order. In this simple case the source XML document has just one text node with string value the string "Hello, World!
".