Hi All, I am facing one problem while writing one xslt:
xml:
<students>
<studentDetails tag="to" id="1" fname="AA"/>
<studentDetails tag="mo" id="2" fname="BB"/>
</students>
writing a xslt i have to convert it into HTML:
<table>
<tr>
<th>to</th>
<th>mo</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>AA</td>
<td>BB</td>
</tr>
</table>
Now how to write this xslt?
I have tried
<xsl:template match="students">
<table>
<tr>
<xsl:apply-templates select="studentDetails"/>
</tr>
</table>
</xsl:template>
<xsl:template match="studentDetails">
<th>
<xsl:call-template name="zz">
<xsl:with-param name="child-name" select="'tag'"/>
</xsl:call-template>
</th>
<td></td>
</xsl:template>
<xsl:template name="zz">
<xsl:param name="child-name"/>
<xsl:value-of select="@*[name() = $child-name]"/>
</xsl:template>
for its working but then my logic fails. Can somebody suggest how to code this one.