|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl structuring....
Saif Khaja wrote:
>
> Hi everyone,
> I am having a structuring problem with displaying the xml file in the format
> I want.
I think this will do what you want
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="History">
<table>
<xsl:apply-templates select="des/desRow | asis/asRow">
<xsl:sort select="name" />
</xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="desRow | asRow">
<xsl:if test="not(name = preceding::name)">
<tr>
<td><xsl:value-of select="name" /></td>
<td>
<xsl:choose>
<xsl:when test="name() = 'desRow'"><xsl:value-of
select="qty"/></xsl:when>
<xsl:otherwise>-</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="../../asis/asRow[name = current()/name]/qty">
<xsl:value-of select="../../asis/asRow[name =
current()/name]/qty"/>
</xsl:when>
<xsl:otherwise>-</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Gary
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








