Subject: Re: how to view data in tabuler view
From: "Mohamed Abdel Hamid" <mohamed@xxxxxxxxxxxx>
Date: Sun, 3 Nov 2002 17:58:40 +0200
|
Hallo Vasu
thanx for your solution
i try it and it works good now
thanx
----- Original Message -----
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, October 31, 2002 4:51 PM
Subject: Re: how to view data in tabuler view
> Hi Mohammed,
> try the following code..
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="document">
> <table border="1" width="100%">
> <tr>
> <!-- when you create the caption names in the table, only iterate through
> the first row.
> since you do not want the caption "currency" to appear , skip it -->
> <xsl:for-each select="row[1]/item[not(caption = 'currencey')]">
> <td width="25%">
> <xsl:value-of select = "caption"/>
> </td>
> </xsl:for-each>
> </tr>
> <!-- now iterate through all the rows -->
> <xsl:for-each select="row">
> <tr>
> <xsl:for-each select="item[not(caption = 'currencey')]">
> <td width="25%">
> <xsl:choose>
> <xsl:when test="caption = 'Unit Price'">
> <!-- concatinate the amount of the caption:UnitPrice with the
amount
> of the Caption:Currencey of the Current **row** -->
> <xsl:value-of select = "concat(amount,'
> ',../item[caption='currencey']/amount)"/>
> </xsl:when>
> <xsl:otherwise>
> <xsl:value-of select = "amount"/>
> </xsl:otherwise>
> </xsl:choose>
> </td>
> </xsl:for-each>
> </tr>
> </xsl:for-each>
> </table>
> </xsl:template>
> </xsl:stylesheet>
> This should give you an output that looks like..
> product no Unit Price quantity total price
> 123456 23.5 Euro 2 47
> 231253 20 Euro 5 100
> 42152 15 Euro 3 45
>
>
> ps: Currencey should be *Currency*. It is misspelt in your code and in
mine
> :).
>
> HTH
> Vasu
> ----- Original Message -----
> From: "Mohamed Abdel Hamid" <mohamed@xxxxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Thursday, October 31, 2002 1:54 PM
> Subject: Re: how to view data in tabuler view
>
>
> > Hallo Vasu
> >
> > the output i want is like this :-
> >
>
> --------------------------------------------------------------------------
> --
> > ---------------
> > product no. Unit price quantity total price
> > 1254 25 Euro 5 125
> > 1524 12 Euro 2 24
>
> --------------------------------------------------------------------------
> --
> > ---------------
> > also i want to put currency adjacent to price not a separate field
> > thanx
> >
> > ----- Original Message -----
> > From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
> > To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> > Sent: Thursday, October 31, 2002 2:14 PM
> > Subject: Re: how to view data in tabuler view
> >
> >
> > > Hi Mohammed
> > > Give an example of your final output. That would help us understand
the
> > > problem better
> > > Thanks
> > > Vasu
> >
> >
> > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
> >
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|