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

RE: reccursive sum ?

Subject: RE: reccursive sum ?
From: "Ricaud Matthieu" <matthieu.ricaud@xxxxxxx>
Date: Tue, 2 Mar 2004 17:25:32 +0100
xsl sum at attributes
The goal of all this transformation is to prevent using a variable, is it ?
I find it's a lot to do (it has many consequences on the whole project) and
don't see perfectly what the use of it.

Is it just a question of efficiency ? It's true when I have A huge quantity
of files to scan, then it might be longer. actually there will never be more
than about 10 files to be read.

Is it to make the code shorter (and cleaner ?). In this case, would your
intermediary solution not be enough :
document(concat($Meid,'.xml')

Maybe I don't yet see everything but for sure I keep this advices and will
probably come back to it.

-----Message d'origine-----
De : owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]De la part de David
Carlisle
Envoyé : mardi 2 mars 2004 14:59
À : xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Objet : Re:  reccursive sum ?



  I don't see the link between concat id + ".xml" and the <xsl:value-of
  select="document($theFileName)..."/>
  $theFileName is not a node set, no ?

That's right: if you use concat (or a xsl:variable with content) then
$theFileName is only a string and so document() will only load one file,
but if your attributes had the full file name then you could do
document(ME/@id)
and now the argument to document() _is_ a node set of all the id
attributes of all your ME elements, and in that case document() loads
_all_ of the referenced files in one go.

assuming your processor has a node-set() extension (most do) then
since you don't want to change your input you just need to go

<xsl:variable name="addxml">
<xsl:for-each select="ME">
  <ME id="{@id}.xml"/>
</xsl:for-each>
</xsl:variable>

then


	select="count(document(saxon:node-set($addxml)/ME/@id)/ME/FOURN/DEVOIR"/>

is the number you are after, if you are not using saxon replace
saxon:node-set by your system's node set extension function.

david

--
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.