|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] What am I doing wrong?
Hi,
Anybody who can point what am i doing wrong? I am not getting the desired output. The first line is correct but after that three subsequent lines are not. The output is missing one '<td></td>' somehow for those three lines. Thanks in advance. Arun Here is the XML file :-
<Group>
<GroupValue type='alpha'>SUPP1</GroupValue>
<AssociateValue type='alpha'>Software House</AssociateValue>
<Group>
<GroupValue type='alpha'>PO000001</GroupValue>
<AssociateValue type='numeric'>1</AssociateValue>
<Row>
<ColumnValue type='alpha'>SU-1000</ColumnValue>
<ColumnValue type='numeric'>840</ColumnValue>
<ColumnValue type='date'>12/06/2000</ColumnValue>
<ColumnValue type='numeric'>24</ColumnValue>
<ColumnValue type='alpha'>Released</ColumnValue>
<ColumnValue type='numeric'>1.00000000</ColumnValue>
</Row>
<AssociateValue type='numeric'>2</AssociateValue>
<Row>
<ColumnValue type='alpha'>BOX-1</ColumnValue>
<ColumnValue type='numeric'>0</ColumnValue>
<ColumnValue type='date'>12/06/2000</ColumnValue>
<ColumnValue type='numeric'>1</ColumnValue>
<ColumnValue type='alpha'>Released</ColumnValue>
<ColumnValue type='numeric'>1.00000000</ColumnValue>
</Row>
<AssociateValue type='numeric'>10</AssociateValue>
<Row>
<ColumnValue type='alpha'>BOX-2</ColumnValue>
<ColumnValue type='numeric'>20</ColumnValue>
<ColumnValue type='date'>31/12/2003</ColumnValue>
<ColumnValue type='numeric'>20</ColumnValue>
<ColumnValue type='alpha'>Released</ColumnValue>
<ColumnValue type='numeric'>1.00000000</ColumnValue>
</Row>
</Group>
<Group>
<GroupValue type='alpha'>PO000005</GroupValue>
<AssociateValue type='numeric'>1</AssociateValue>
<Row>
<ColumnValue type='alpha'>CD-2000</ColumnValue>
<ColumnValue type='numeric'>0</ColumnValue>
<ColumnValue type='date'>12/07/2003</ColumnValue>
<ColumnValue type='numeric'>10</ColumnValue>
<ColumnValue type='alpha'>Released</ColumnValue>
<ColumnValue type='numeric'>1.00000000</ColumnValue>
</Row>
</Group>
</Group>
<TabularReport>Following is the XSL :- <?xml version="1.0" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/TabularReport"> <html><head><title></title></head><body><left>
<table>
<tr>
<xsl:apply-templates select="Titles/Title" />
<xsl:apply-templates select=".//Row" />
</tr>
</table>
</left></body></html></xsl:template> <xsl:template match="Row"> <xsl:variable name="row-id" select="generate-id(.)" /> <tr> <xsl:for-each select="ancestor::Group"> <xsl:variable name="first-row-id" select="generate-id(descendant::Row[1])" /> <xsl:choose> <xsl:when test="$row-id = $first-row-id"> <td><xsl:value-of select="child::GroupValue" /></td> <xsl:if test="child::AssociateValue[1]"> <td><xsl:value-of select="child::AssociateValue[1]" /></td> </xsl:if> </xsl:when> <xsl:otherwise> <td></td> </xsl:otherwise> </xsl:choose> </xsl:for-each> <xsl:if test="name(preceding-sibling::node()[2]) != 'GroupValue'"> <xsl:if test="preceding-sibling::AssociateValue[1]"> <td><xsl:value-of select="preceding-sibling::AssociateValue[1]" /></td> </xsl:if> </xsl:if> <xsl:apply-templates select="ColumnValue" /> </tr> </xsl:template> <xsl:template match="Title"> <td><font color="red" size="2pt"><xsl:value-of select="." /></font></td> </xsl:template> <xsl:template match="ColumnValue"> <td><font color="black" size="2pt"><xsl:value-of select="." /></font></td> </xsl:template> </xsl:stylesheet> _________________________________________________________________ The new MSN toolbar! Your shortcut to the internet! http://toolbar.msn.co.in/ Access a world of convenience!
|
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








