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

RE: Using "except" with node sequences

Subject: RE: Using "except" with node sequences
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 4 Aug 2008 20:02:04 +0100
RE:  Using "except" with node sequences
> Also, thanks Michael for your suggestion.  The code I posted 
> was a simplified form of my actual code, in which I'm 
> combining two sequences produced by two different functions, 
> both of which are a bit complex for a single predicate:
> 
> 	select="$active_data except $new_data"
> 
> Both of these variables are constructed by functions executed 
> on the original $normalized_data variable.  Both use 
> <xsl:sequence /> to return a sequence of elements.  My 
> impression was that by using <xsl:sequence />, I am returning 
> references to the existing nodes in $normalized_data, and not 
> actually creating copies of those nodes in memory.  Is this 
> in fact the case?

yes.
> 
> An alternate method I considered was to create Boolean 
> functions that would allow me to construct a predicate like 
> you suggested:
> 
> 	select="$normalized_data[fn:active(.) and not(fn:new(.)]
> 
> But since I use $active_data and $new_data elsewhere in my 
> stylesheet, I decided against it, trying to avoid evaluating 
> those Boolean functions more than necessary.  
> 
> In general, which approach is better practice?  

I would think the boolean function probably gives better reusability.

Michael Kay
http://www.saxonica.com/

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-2011 All Rights Reserved.