Quote:
Originally Posted by mrame
Please post your xml, xslt code and the required output. Someone here can help you.
|
Hi every 1,
This is my XML file below:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet type="text/xsl" href="EmpXSL.xsl"?>
<Employees>
<Employee id="001">
<First-Name>Vinay</First-Name>
<Last-Name>Kumar</Last-Name>
<Designation>Trainee</Designation>
<DOB>17/02/82</DOB>
<Team>Ovid</Team>
<BloodGrp>O+ve</BloodGrp>
<Address>Pune1</Address>
</Employee>
<Employee id="002">
<First-Name>Deepak</First-Name>
<Last-Name>Singh</Last-Name>
<Designation>Trainee</Designation>
<DOB>17/02/82</DOB>
<Team>Ovid</Team>
<BloodGrp>O+ve</BloodGrp>
<Address>Pune</Address>
</Employee>
</Employees>
and i have used code is:
<xsl:output method="html" indent="yes"/>
<xsl:template match="/*">
<table border="1">
<thead>
<tr>
<xsl:apply-templates select="*[1]" mode="th"/>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="*"/>
</tbody>
</table>
</xsl:template>
<xsl:template match="/*/*/*" mode="th">
<th>
<xsl:value-of select="name()"/>
</th>
</xsl:template>
<xsl:template match="/*/*">
<tr>
<xsl:apply-templates select="*"/>
</tr>
</xsl:template>
<xsl:template match="/*/*/*">
<td>
<xsl:value-of select="@* | text()"/>
</td>
</xsl:template>
</xsl:stylesheet>
I am getting output ok but the thing is how to get ID attribute to b place before First-Name.Both name n value using same code for xsl.
Also I need to understand how the flow is working.....
If any 1 may help me out...
Thanks n Regards.