다른 구조 요소에 스타일 요소를 적용하는 방법을 알아 내려고하고 있습니다.XSLT 텍스트 노드 복제
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist><bold>Bob</bold> Dylan</artist>
</cd>
<cd>
<title>Hide your <bold>heart</bold></title>
<artist>Bonnie Tyler</artist>
</cd>
</catalog>
그리고 내 최신 XSLT 시도가이
<?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="bold">
<b><xsl:value-of select="." /></b>
</xsl:template>
<xsl:template match="/catalog">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="cd">
<tr>
<td><xsl:value-of select="title" /><xsl:apply-templates/></td>
<td><xsl:value-of select="artist" /><xsl:apply-templates/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
처럼 보이지만 결과는 굵은 글씨로 원하는 부분을하는 대신 데이터를 복제 :
내 XML은 다음과 같습니다.