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

repeat and replace loop ( at the same time )

Subject: repeat and replace loop ( at the same time )
From: progressdll linux <progressdll.linux@xxxxxxx>
Date: Tue, 2 Apr 2002 16:40:35 +0200 (GMT+02:00)
2 loops same time
repeat and replace loop	( at the same time )

I have difficult time trying the following in XSLT.

I need to repeat an XML record and replace it at the same time with different data.
Let me show you an example:

<root>
  <record>
    <namedcell name="ordernumber"/>
    <data>0</data>
    <namedcell name="price"/>
    <data>0</data>
  </record>
</root>

this is my template record that i want to use to fill my output xml.
So i need to repeat the template record as many time as i want records
and replace the data at the same time.

I am able to repeat and replace but not in 1 go. The replace data comes
from a second xml that will replace according to the namedcell value.

<root>
  <record>
     <ordernumber>1</ordernumber>
     <price>111</price>
  </record>
  <record>
     <ordernumber>2</ordernumber>
     <price>222</price>
  </record>
</root>

So this should result in 2 record. I always read this xml in via the document function.
<xsl:variable name="file" select="document('replace_data.xml')"/>

and on match = "record" i apply this template.
<xsl:apply-templates select="$file/root"/>
This will loop x time that there are record.

But then i can't replace the data. 

result should be

<root>
  <record>
    <namedcell name="ordernumber"/>
    <data>1</data>
    <namedcell name="price"/>
    <data>111</data>
  </record>
  <record>
    <namedcell name="ordernumber"/>
    <data>2</data>
    <namedcell name="price"/>
    <data>222</data>
  </record>
</root>

Thanks for any feedback. I am really stuck.
PG
-----------------------------------------------------
Mail.be, Free WebMail and Virtual Office
http://www.mail.be


 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.