次のスタイルシート:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h1>Music Collection:</h1>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<tr>
<td><xsl:value-of select="catalog/cd/title" disable-output-escaping="yes" /></td>
<td><xsl:value-of select="catalog/cd/artist" /></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
次のHTMLで使用すると、に変換<
されないのはなぜですか?<
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<catalog>
<cd>
<title>Empire Burlesque < </title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia </company>
<price>10.90</price>
<year>1985</year>
</cd>
</catalog>
出力はここでテストできます。http://www.w3schools.com/xsl/tryxslt.asp? xmlfile = cdcatalog&xsltfile = tryxsl_value-of
編集
これが機能しない別の例です
<xsl:for-each select="//productType">
<xsl:value-of select="." disable-output-escaping="yes" />
<br></br>
</xsl:for-each>
DOEを使用すると、<が削除されます。それがないと、<文字が表示されます(XSLT 1.0を使用)