Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 12th, 2004, 07:07 PM
Registered User
 
Join Date: Nov 2004
Location: Bangalore, Karnataka, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default adding of element and assigning to one element

Hi

I am having this problem.I have tried to make the xml simple.
Input XML
<test>
    <qty>
        <one>2</one>
    </qty>
    <qty>
        <one>3</one>
    </qty>
    <qty>
        <one>4</one>
    </qty>
    <qty>
        <one>5</one>
    </qty>
</test>
and out put xml

<result>
    <add></add>
</result>

the value of the "add" should be the addition of element value "one"

Like <add>2+3+4+5</add>

Plz let me now if any one can help me out.

Datta

Reply With Quote
  #2 (permalink)  
Old November 12th, 2004, 08:44 PM
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to jkmyoung
Default

did you actually want the string '2+3+4+5' or did you want 14?

if 14, it'd be <add><xsl:value-of "sum(test/qty/one)"/></add>
(assuming you're starting from the test node)

if you want the string, try a for-each loop. http://www.w3schools.com/xsl/default.asp

Reply With Quote
  #3 (permalink)  
Old November 16th, 2004, 07:04 PM
Registered User
 
Join Date: Nov 2004
Location: Bangalore, Karnataka, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a lot jkm


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem adding element to the previous element dani1 XSLT 5 September 10th, 2008 01:38 AM
Assigning node value to a href element!!!!!!!!! rakesh XSLT 4 July 25th, 2008 03:17 PM
Adding a new Element monuindia2002 XML 2 March 13th, 2006 11:59 PM
assigning a css style sheet from an element miguel XSLT 7 August 8th, 2004 01:21 PM
Adding an element to a binded DropDownlist mahulda ASP.NET 1.0 and 1.1 Basics 3 March 10th, 2004 03:12 PM



All times are GMT -4. The time now is 08:13 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.