[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Hash-Table in xsl?

Subject: Re: Hash-Table in xsl?
From: "Pankaj Shinde" <shinde_pankaj@xxxxxxxxxxxxxx>
Date: Fri, 22 Feb 2002 18:25:22 +0530
pankaj shinde
The output html has not come out in the way i wanted it to.

Output required is :
-------------------

<table>
<tr>
<td></td>
<td>Company1</td>
<td>Company2</td>
</tr>
<tr>
<td>Commodity1</td>
<td>11</td>
<td>21</td>
</tr>
<tr>
<td>Commodity2</td>
<td></td>
<td>22</td>
</tr>
<tr>
<td>Commodity3</td>
<td>13</td>
<td></td>
</tr>
</table>



----- Original Message -----
From: "Pankaj Shinde" <shinde_pankaj@xxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, February 22, 2002 5:56 PM
Subject:  Hash-Table in xsl?


> Hi,
>
> Can one create a hash table some how in xsl?
>
> My input xml :
> --------------
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <wrapper>
>  <data>
>   <company>company1</company>
>   <commodity>commodity1</commodity>
>   <units>11</units>
>  </data>
>  <data>
>   <company>company2</company>
>   <commodity>commodity2</commodity>
>   <units>22</units>
>  </data>
>  <data>
>   <company>company1</company>
>   <commodity>commodity3</commodity>
>   <units>13</units>
>  </data>
>  <data>
>   <company>company2</company>
>   <commodity>commodity1</commodity>
>   <units>21</units>
>  </data>
> </wrapper>
>
> My output html :
> ----------------
>
>
>      Company1
>      Company2
>
>       Commodity1
>      11
>      21
>
>       Commodity2
>
>      22
>
>       Commodity3
>      13
>
>
>
>
>
>
> My Logic :
> ----------
>
> for each data node
>  if value of company has not been seen earlier
>   create new column with value of company as heading for that column
>   if value of commodity has not been seen earlier
>    create new row with value of commodity as heading for that row
>    put value of commodity in correct place.
>  else
>   if value of commodity has not been seen earlier
>    create new row with value of commodity as heading for that row
>    put value of commodity in correct place.
>
> Problem :
> ---------
> 1. I can use preceding-sibling for checking whether "value of company is
> new" or "value of commodity is new". But this
> screws up performance for large xmls.
> 2. I can use java.util.Hashtable from within my xsl. How will this affect
my
> performance.
> 3. Can Meunchian be modified for this problem?
>
> Any help is appreciated.
>
> regards,
> <panx/>
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.