<xsl:output method="種類"/>を使い出力結果文書の種類を指定。"xml"、"html"、"text"を指定できる(IE6の表示上では"xml"と"html"との差はない)。テキスト形式("text")は、テキストだけがそのまま出力され、HTMLタグなどは反映しない。
テキスト形式("text")の[サンプルルXML文書を表示](下のフレームに)
*同じサンプルXML文書を使い"htnl"形式で出力したのが「XSLでHTMLタグやCSSを利用」
XMLソース
<?xml version="1.0" encoding="Shift_JIS" ?>
<?xml-stylesheet type="text/xsl" href="output01.xsl"?>
<root>
<title>2003年11月05日の東証株式第一部情報</title>
<info><name>銘柄</name><end>終値(円)</end><total>出来高(千株)</total></info>
<data>
<name code="6752">松下<end>1529</end><total>12302</total></name>
<name code="6753">シャープ<end>1786</end><total>3964</total></name>
<name code="6758">ソニー<end>4030</end><total>8220</total></name>
<name code="6764">三洋<end>516</end><total>7551</total></name>
<name code="6501">日立<end>692</end><total>21896</total></name>
<name code="6502">東芝<end>440</end><total>17832</total></name>
<name code="6701">NEC<end>1027</end><total>19229</total></name>
<name code="6702">富士通<end>708</end><total>16634</total></name>
</data>
<end>以上です(2003/11/07)</end>
</root>
XSLソース
<?xml version="1.0" encoding="Shift_JIS"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="Shift_JIS"/>
<xsl:template match="/">
<H3 style="color:blue">=== <xsl:value-of select="root/title"/> ===</H3>
<HR style="margin:2mm 2cm;color:green"/>
<DIV style="margin-left:3cm">表示する情報は<BR/>[
<span style="color:red;font-size:12px">
<xsl:value-of select="root/info/name"/>,
<xsl:value-of select="root/info/end"/>,
<xsl:value-of select="root/info/total"/>
</span> ]<BR/>
です
</DIV><HR/>
<ABC><i>(2003/11/07)</i></ABC>
</xsl:template>
</xsl:stylesheet>
end(03/11/7)