|
Subject: [xsl] 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) |
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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] xsl value-of, Jeni Tennison | Thread | Re: [xsl] repeat and replace loop (, Jeni Tennison |
| Re: [xsl] xsl value-of, Jeni Tennison | Date | Re: [xsl] repeat and replace loop (, Jeni Tennison |
| Month |