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

Re: Functions Returning Nodes in XSLT 2.0

Subject: Re: Functions Returning Nodes in XSLT 2.0
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 20 May 2005 14:41:07 +0100
xslt php function
Michael,

  , a call to document() within xsl:copy-of can be regarded as a function that
  returns the document with the opposite guarantee, that you will get
  different nodes each time: which means that the source document will be read
  repeatedly rather than being stored in memory. In your case this is not the
  right strategy!

Is that 100% safe? Apart from the internal detail that internal node ids
are supposed to be preserved I always read the XSLT conditions on
document() as ensuring that I'd get the same text back even in the face
of the source document changing during the run of xslt.





given

<xsl:variable name="a">
 <xsl:copy-of select="document('http://www.worldtimezone.com/time/wtzresult.php?CiID=12008')"/>
</xsl:variable>
<xsl:variable name="b">
 <xsl:copy-of select="document('http://www.worldtimezone.com/time/wtzresult.php?CiID=12008')"/>
</xsl:variable>


(Ignoring the fact that this is returning html rather the xml, for now)

Can't I be assured that string($a) = string($b) is true?

(I agree that this is an edge case as transforming any document that is
changing rapidly enough for this to matter is always going to be an essentially
non-deterministic, and certainly non-repeatable, operation)




  Another new optimization that's coming along soon is that an expression like
  the one in your example will automatically use indexing without you asking
  for it. In the meantime, though, using xsl:key for this kind of construct is
  usually a good idea.

Ahh, you are just being kind to our key-less cousins over in
Xquery-land:-)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. 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
________________________________________________________________________

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.