Hallo allerseits, ich bin neu bei xml/xsl. Ich habe folgende XML-CodeXSLT ID ersetzen, Wert eines anderen Knotens abrufen
<?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>
es in einer Tabelle zu zeigen, ich habe folgende (in Betrieb) XSL-Code:
<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>
Anstelle des categoryId
ich es mit dem Kategorienamen ersetzen möchten (siehe Knoten categories
). Sind irgendwelche Vorschläge?
Oh, verdammt ich schon fast das gleiche versucht, aber mein „Spiel“ war falsch: D vielen Dank, Kumpel;) – Trace