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

Re: XSLT: Taking Value of One Attribute and Smearing i

Subject: Re: XSLT: Taking Value of One Attribute and Smearing it Across multiple times
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Fri, 04 May 2007 15:27:42 +0300
Re:  XSLT: Taking Value of One Attribute and Smearing i
Hi Rex,

If XSLT 2.0 is ok for you then all you need is as simple as:

<xsl:template match="offers">
<xsl:value-of select="for $i in fcst/@start_hr to fcst/@end_hr return (fcst/@value)" separator=","/>
</xsl:template>


Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Rex Rex wrote:
I am new to XSLT. I have this problem to resolve.

For a given XML tree like this, where a single value is specified for
a range of hours -- from hour 1 to end hour 10, I would like to
explode this single value ten times.

i.e., for a source XML like this,

<?xml version="1.0"?>
<offers>
 <fcst start_hr="1" end_hr="10" value="100"/>
</offers>

I need an output like this... (explode the value of 100 from hr=1 to
hr=10, ten times.)

100,100,100,100,100,100,100,100,100,100

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.