0
안녕하세요, 저는 xml/xsl을 처음 접했습니다. 내가, 내가 (작업) XSL 코드 다음 한 테이블에서 보여 XML 코드를XSLT 이드 바꾸기, 다른 노드의 값 가져 오기
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="Miau.xsl"?>
<export xmlns="urn:VocabularyExport">
<categories>
<category name="A" id="123" />
<category name="B" id="456" />
</categories>
<vocables>
<vocable categoryId="123" spanishWord="uno" engWord="one" id="45d0a344-785b-
4463-9877-5474c99fdc74" />
<vocable categoryId="456" spanishWord="dos" engWord="two" id="03efffbb-1cbf-
44f9-a377-74da252daac0" />
</vocables>
</export>
다음 한 대신 내가 카테고리 이름으로 대체 할 categoryId
의
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:l="urn:VocabularyExport">
<xsl:key name="category" match="category" use="@id" />
<xsl:template match="/">
<html>
<body>
<h1>My Vocable Colletion</h1>
<table border="1">
<tr bgcolor="#9acd32">
<th>Id</th>
<th>Deutsches Wort</th>
<th>Spanishes Wort</th>
<th>CategoryId</th>
</tr>
<xsl:for-each select="l:export/l:vocables/l:vocable">
<tr>
<td>
<xsl:value-of select="@id"/>
</td>
<td>
<xsl:value-of select="@germanWord"/>
</td>
<td>
<xsl:value-of select="@spanishWord"/>
</td>
<td>
<xsl:value-of select="@categoryId"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
(참조 노드 categories
). 제안이 있습니까?
아, 젠장 난 이미 거의 같은 시도했지만 내 "일치"거짓 : D 유 대단히 고맙다;) – Trace