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

RE: alternative to namespace exmaple

Subject: RE: alternative to namespace exmaple
From: "Mark Lundquist" <ml@xxxxxxxxxxxxxx>
Date: Thu, 13 Jan 2005 09:26:09 -0800
xsl subtract
> From: dmitrik@xxxxxxxxxxxxxx [mailto:dmitrik@xxxxxxxxxxxxxx]
>
> I found a very similar version of the following xml and xsl
> online. In this code namespaces are used
> in order to subtract the sums for us and them. My xml code is
> structured similarly, and was summing
> values for all of the xml. The xsl now needs to subtract in a
> similar way to this example. Is this the
> best way to do it? By assigning namespaces to the xml tags? Or is
> there a better alternative?

Hi Dmitri,

I think maybe you are misinterpreting that example? :-).  The use of
namespaces in the example code is arbitrary and not essential - it's not a
part of the solution to the problem, just part of the set-up for the
example.  The data has to come from _somewhere_ :-)...  I'm sure the intent
of the sample code is not to say, "OK, if you want to subtract two sums, you
should start by structuring your data in this particular way with these
namespaces."  The goal isn't to be able to copy+paste that example code
verbatim.

> <xsl:value-of select="format-number(sum(//us:value) - sum(//them:value),
> '###,###,##0.00')" />

Right, that's pretty much all there is to it.  You would write that as

<xsl:value-of select="format-number(sum(//us-value) - sum(//them-value),
 '###,###,##0.00')" />

if that's how your data is structured... or whatever! :-)

HTH,
-ml-

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.