<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I'm trying to transform a xmldocument to HTML and I'm just stuck with this
problem. Hope U have patience with my question :-)
<p>I have this XML file:
<br><myml>
<br> <b> <items></b>
<br> <item>
<br>
<id><b>hej</b></id>
<br>
<domain>nisse</value>
<br>
<params>
<br>
<param>
<br>
<name> hup</name>
<br>
<value> 22</value>
<br>
</param>
<br>
<param>
<br>
<name> huj</name>
<br>
<value> 23</value>
<br>
</param>
<br>
<param>
<br>
<name> hopp</name>
<br>
<value> 24</value>
<br>
</param>
<br>
</params>
<====== My problem is here when i need to go one level deeper in my
<br> <b>
<items> </b>
<====== xml-stucture.
<br>
<item>
<br>
<id><b>hej:hej1</b></id>
<br>
<domain>nisse</value>
<br>
<params>
<br>
<param>
<br>
<name> hubba</name>
<br>
<value> 25</value>
<br>
</param>
<br>
<param>
<br>
<name> bubba</name>
<br>
<value> 26</value>
<br>
</param>
<br>
</params>
<br>
</item>
<br> </items>
<br></myml>
<p>What kind of xsl code do I need to be able to display the deeper level?
Should I use a <xsl:if> statement to be able to do items again i the
deeper level and in that case, how will the syntax look like?
<p>My current XSL file is shown below if it might be of any help. Now it
prints:
<br>id: hej domain:nisse
<br><b>name value</b>
<br>hup 22
<br>huj 23
<br>hopp 24
<p>it does not continue with:
<br>id hej:hej1 domain:nisse
<br><b>name value</b>
<br>hubba 25
<br>bubba 26
<p>What can I put in my xsl file to make this happen??
<br>
<p><?xml version="1.0"?>
<br><xsl:stylesheet xmlns:xsl="<A HREF="http://www.w3.org/XSL/Transform/1.0">http://www.w3.org/XSL/Transform/1.0</A>">
<br> <xsl:template match="/">
<br> <html>
<br> <head>
<br> <title>***
cnaml filen ***</title>
<br> </head>
<br> <body bgcolor="ffff00">
<br> <P> <font
face="Times, serif" color="blue" size="3">**XML-listan**</font></P>
<br> <xsl:apply-templates
select="cnaml" />
<br> </body>
<br> </html>
<br> </xsl:template>
<br> <xsl:template match="myml">
<br> <xsl:apply-templates select="items"
/>
<br> </xsl:template>
<p> <xsl:template match="items">
<br> <xsl:apply-templates select="item" />
<br> </xsl:template>
<br>
<br> <xsl:template match="item">
<br> <table BORDER="3" CELLSPACING="1" CELLPADDING="1">
<br> <tr><p>
<br>
<td>
<br> <font face="Times, bold" color="purple" size="3">
<br>IDENTITY:<xsl:value-of select="id"/>
<br> </font>
<br> </td>
<br> <td>
<br> <font face="Times, bold" color="purple" size="3">
<br>DOMAIN: <xsl:value-of select="domain"/>
<br> </font>
<br> </td>
<br> </p>
<br> </tr>
<br></table>
<br> <xsl:apply-templates select="params"/>
<br> </xsl:template>
<br>
<br> <xsl:template match="params">
<br> <table BORDER="3" CELLSPACING="1"
CELLPADDING="1">
<br> <th>Name</th>
<br> <th>Value</th>
<br>
<xsl:apply-templates select="param"/>
<br> </table>
<br> </xsl:template>
<p> <xsl:template match="param">
<br> <tr>
<br> <td>
<br> <font face="Times, serif" color="blue" size="2">
<br> <xsl:value-of select="name"/>
<br> </font>
<br> </td>
<br> <td>
<br> <font face="Times, serif" color="green" size="2">
<br> <xsl:value-of select="value"/>
<br> </font>
<br> </td>
<br> </tr>
<br> </xsl:template>
<br></xsl:stylesheet>
<br>
<p>Hope this question is OK for this list, it si something I have been
stuck with for a while and I hope someone might look in to it. By the way
I use XT to transform from XML to HTML
<p>//Peter</html>