Hi all, I am a total newbie to xml/xslt :(, so I guess my question is easy to answer, but I didn't find anything on the net to make this work, so I'm hoping for an answer here.
I am creating an xslt to view an existing xml in html. Here's an example of what I am basically trying to do (I know it's not a very good example, but I can't post the original one)
Xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="C:\source\Richtlinien\test.xsl"?>
<nda:books xmlns:nda="http://www.nda.de">
<book>
<author name="King" firstname="Stephen">
<title name="the shining" language="english"/>
<title name="Carrie" language="german"/>
</author>
</book>
<book>
<author name="Rowlings" firstname="JK">
<title name="Socerer Stone" language="english"/>
<title name="Prisoner of Azkaban" language="english"/>
</author>
</book>
</nda:books>
and here's the xslt I am trying to create:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:nda="http://www.nda.de">
<xsl:template match="/">
<html>
<body>
<table border="1">
<tr>
<th>name</th>
<th>firstname</th>
<th>title</th>
</tr>
<xsl:for-each select="nda:books/book/author">
<tr>
<td>
<xsl:value-of select="@name"/>
</td>
<td>
<xsl:value-of select="@firstname"/>
</td>
<td>
<table border="1">
<tr>
<th>name</th>
<th>language</th>
</tr>
<xsl:for-each select="nda:books/book/author/title">
<tr>
<td>
<xsl:value-of select="@name"/>
</td>
<td>
<xsl:value-of select="@language"/>
</td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
So I am trying to create a table which contains the values of the xml. Now, the values of the outer table are displayed fine, but not the values of the inner table. How can I make this work? I am thankful for any help!!
Thx a lot!