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

how to update a variable (grouping question)

Subject: how to update a variable (grouping question)
From: S M <sm94066@xxxxxxxxx>
Date: Mon, 8 Aug 2005 18:48:19 -0700
where variable
I am trying to retrieve data from a table structure (xml table) where
after every few rows a special row appears which contains a piece of
data which is relevant to rows appearing immidiatley after it (i.e.
its next few siblings).  I am having hard time figuring out how to
achieve this without a dynamically assigned variable in XSL.

Test data looks like this:

	<row type="header">
	<row type="data">
		<col>10 at 6pm</col>
	<row type="data">
		<col>21 at 8pm</col>
		<col>New York</col>
	<row type="data">
		<col>31 at 8pm</col>
	<row type="header">
	<row type="data">
		<col>16 at 9pm</col>
	<row type="data">
		<col>31 at 7pm</col>

and the desired output is:
	<date>January 10 at 6pm</date>
	<date>January 21 at 8pm</date>
	<date>January 31 at 8pm</date>
	<date>March   16 at 9pm</date>
	<date>March   31 at 7pm</date>

basically what I am trying to figure out is how I can save the value
of col[1] in a varaible WHEN row[@type='header'] and then append the
value of this variable to all of the following col[1] values UNTIL the
next row[@type='header] is reached ?

Any suggestions, pointers, hints  ?


Current Thread


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.
First Name
Last Name
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.