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

RE: Whats Wrong with: <xsl:value-of select="//exec[@s

Subject: RE: Whats Wrong with: <xsl:value-of select="//exec[@stepid=$temp_step]/dds/dd[logical/@id=$temp_id]" />
From: Mike Ferrando <mikeferrando@xxxxxxxxx>
Date: Fri, 12 Nov 2004 06:33:07 -0800 (PST)
select from exec
Andrew,
Thanks. I didn't know there was such a great difference between these
methods.

I wonder how someone might do this if they were using only single
quotes for their xsl attributes?

Example:
<xsl:variable name='x' select='@my_attribute'/>

Mike Ferrando
Library Technician
Music Division
Library of Congress
Washington, DC
202-707-4454

--- Andrew Welch <ajwelch@xxxxxxxxxxxxxxx> wrote:

> 
> 
> > Friends,
> > To expand on David's post, I find it easier and less liable 
> > to error to express the variable this way when I want a 
> > string:  XLST 1.0
> >   <xsl:variable name="temp_id">SORTOUT</xsl:variable>
> 
> The problem here is that you are creating a temporary tree, which
> has a
> root and a single text node child.  Doing a value-of on the tree
> will
> return the string 'SORTOUT', as it returns all the text-nodes for
> the
> tree concatenated together, however, there is comparitively massive
> cost
> in constructing the tree and the holding it in memory.
> 
> Using <xsl:variable name="temp_id" select="'SORTOUT'"/> simply
> binds the
> string to the variable, and incurs no tree creation costs or the
> extra
> memory use.
> 
> So, although they appear very similar as using value-of on either
> technique produces the same result, they are actually quite
> different.
> 
> The rule of thumb is - if it's possible to do all the work in the
> select
> attribute do it there.
> 
> cheers
> andrew
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.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-2013 All Rights Reserved.