1. xsl:output



Wendell Piez

The <xsl:output method="xml"/> or method="html" is a top-level stylesheet element (see XSLT Rec section 16). The file name you give to the output file has nothing to do with it -- it could be eg.foo and the serialized format (xml, html, text) would be still be determined by the <xsl:output> element in the stylesheet. (Obviously it's easier for everybody if you give a suffix .xml to files with output method="xml", .html to method="html", etc. But there's nothing magic about the file name.)

If you have no <xsl:output> element in your stylesheet, the default is method="xml" unless the document element of your result tree is 'html' -- see the spec. In either case, you should get element markup in your output when you use <xsl:element> in your stylesheet. When method="text", no element markup appears because no markup appears at all.