Hello
I want to get the attributes's value using @ID without using dtd file.I am little confused How to give X-path for the code written in xsl file.
I am really new to XML and present solustion is not producing any result.
Really appreciate an immediate help.
Many thanks
Adi..
here is my xml file
=====================
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="TestQ.xsl"?>
<results>
<result id="getCount">
<row>
<NOS>1872</NOS>
</row>
</result>
<result id="getDetails">
<row>
<NAME>ABC</NAME>
<DESC>Coverage </DESC>
<SOURCE>Covered Universe</SOURCE>
<NOS>1378</NOS>
</row>
<row>
<NAME>XYZ</NAME>
<DESC>Internal </DESC>
<SOURCE>Coverage Analyst</SOURCE>
<NOS>1822</NOS>
</row>
</result>
</results>
=========================
.xsl file TestQ.xsl
=============================
<xsl:stylesheet
xmlns:xsl="<xsl:template match="results">
<table>
<tr>
<td align="center" >NOS</td>
</tr>
<xsl:for-each select='results/result[@id="getCount"]/row'>
<tr>
<td><xsl:value-of select="NOS"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="results">
<table>
<tr>
<td>NAME</td>
<td>DESC</td>
<td>SOURCE</td>
<td>NOS</td>
</tr>
</table>
</xsl:template>
<xsl:template match="results">
<table>
<xsl:for-each select='results/result[@id="getDetails"]/row'>
<tr>
<td><xsl:value-of select="NAME"/></td>
<td><xsl:value-of select="DESC"/></td>
<td><xsl:value-of select="SOURCE"/></td>
<td><xsl:value-of select="NOS"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
====================================
I want to get the attributes's value using @ID without using dtd file.I am little confused How to give X-path for the code written in xsl file.
I am really new to XML and present solustion is not producing any result.
Really appreciate an immediate help.
Many thanks
Adi..
here is my xml file
=====================
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="TestQ.xsl"?>
<results>
<result id="getCount">
<row>
<NOS>1872</NOS>
</row>
</result>
<result id="getDetails">
<row>
<NAME>ABC</NAME>
<DESC>Coverage </DESC>
<SOURCE>Covered Universe</SOURCE>
<NOS>1378</NOS>
</row>
<row>
<NAME>XYZ</NAME>
<DESC>Internal </DESC>
<SOURCE>Coverage Analyst</SOURCE>
<NOS>1822</NOS>
</row>
</result>
</results>
=========================
.xsl file TestQ.xsl
=============================
<xsl:stylesheet
xmlns:xsl="<xsl:template match="results">
<table>
<tr>
<td align="center" >NOS</td>
</tr>
<xsl:for-each select='results/result[@id="getCount"]/row'>
<tr>
<td><xsl:value-of select="NOS"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="results">
<table>
<tr>
<td>NAME</td>
<td>DESC</td>
<td>SOURCE</td>
<td>NOS</td>
</tr>
</table>
</xsl:template>
<xsl:template match="results">
<table>
<xsl:for-each select='results/result[@id="getDetails"]/row'>
<tr>
<td><xsl:value-of select="NAME"/></td>
<td><xsl:value-of select="DESC"/></td>
<td><xsl:value-of select="SOURCE"/></td>
<td><xsl:value-of select="NOS"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
====================================