BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


XSLT
A simple template to display singular and plural counts
Helpful XSLT ""break"" template
Support automatic transformation using XSLT in IE in side by side mode
Displaying XML data in Pages
Repeated search and replace in XSLT
Combinations of k out of n numbers
Permutations of the values of N nodes
DVC Algorithms in XSLT
Another way of avoiding XSLT processor crash
Re: DVC Algorithms in XSLT
trig functions in xslt
XSLT string Replace function
A Slide-In Menu made with XML/XSLT
What is SVG?
Family Tree maker
Alternative Ordering - ""Women and Children to the lifeboats first""
Restructuring flat delimited XML
Hex and Binary Conversions in XSLT - with Boolean math functions
Using XSLT to produce SVG (1)
Using XSLT to produce SVG (2)


 
 

<< XQuery.NET and XML >>


By Qing-Hua Jiang
First Posted 09/04/2001
Times viewed 230

How to use XSL function sum() to sum 2 XML fields


Summary This examples shows how to find the sum of 2 XML fields using Microsofts nodeset extension.

I recently developed a Ebiz Web Site using XML shopping basket. I found I couldn't use sum(/order/item/QTY*/oder/item/price) to get Total Amount. All I got is the XSL errors. I used msxsl:node-set() instead, which Enables you to convert a tree into a node set. The resulting node always contains a single node and the root node of the tree. In my case here, I created a node that combined 2 nodes, and , the node now actually is the . So I can do sum(QTY*price) now by suming the one sigle node related/multi.

Additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< XQuery.NET and XML >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML