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

Re: quiz on select vs copy-of


xpath quiz

"Oleg A. Paraschenko" <olpa@x...> wrote in message 
20050901234512.0967075d.olpa@x...">news:20050901234512.0967075d.olpa@x......
>  Hello,
>
>  do you know the dark corners of XSLT? Here is one. Compare two
> variables:
>
> <xsl:variable name="v1" select="some-xpath"/>
> <xsl:variable name="v2"><xsl:copy-of select="some-xpath"/></xsl:variable>
>
>  Are "v1" and "v2" the same? I mean: can "v1" and "v2" be used in a
> program interchangeably? Answers:
>
> 1) yes
> 2) no
> 3) implementation-dependant


This is something fundamental and not a dark corner at all.

This is an XSLT FAQ  asked for very frequently in the xsl-list where such 
questions must be directed to.

As defined above, the value of "v1" is of type node-set, while the value of 
"v2" is of type RTF (in XSLT 1.0) or document node (in XSLT 2.0).


There are excellent books by Michael Kay and Jeni Tennison on XSLT (1.0 and 
2.0) and XPath (1.0 and 2.0), which cover in details such questions.

Also, the XSLT FAQ of David Pawson is another great place to look at.


Cheers,
Dimitre Novatchev. 




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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.