Chrome과 Safari에서이 파일을 표시하려고했습니다. 기본적으로 튜토리얼에서이 두 파일을 가져 왔습니다. 그러나 그것이 모두 표시 할 때 원시 XML을 표시하고 xsl 파일을 읽지 않는 것 같습니다. 이 두 파일은 모두 같은 디렉토리에 있습니다.XSL 파일이있을 때 XML의 형식이 지정되지 않았습니다.
도움을 주시면 감사하겠습니다. 미리 감사드립니다.
<?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>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<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>
어리석은 질문이지만 XSLT 파일 이름을 "test.xsl"(대문자 사용)이라고 했습니까? – JLRishe
하하, 예, 방금 다시 확인했습니다. – jaesanx
닫는' xsl : stylesheet>'태그가 없습니다. – Joel