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

Re: Context document with exsl:node-set()?

Subject: Re: Context document with exsl:node-set()?
From: Tony Graham <Tony.Graham@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 Nov 2007 20:55:21 +0000
Re:  Context document with exsl:node-set()?
On Thu, Nov 01 2007 19:32:24 +0000, Scott.Trenda@xxxxxxxx wrote:
> I think I was trying to ask, is the template content of a variable
> treated as its own document? It would make sense if it were,
> considering

XSLT 1.0 [1] says:

   A result tree fragment represents a fragment of the result tree. A
   result tree fragment is treated equivalently to a node-set that
   contains just a single root node.

EXSLT [2] says:

   The exsl:node-set function returns a node-set from a result tree
   fragment (which is what you get when you use the content of
   xsl:variable rather than its select attribute to give a variable
   value).

XPath 1.0 [3] says:

   XPath operates on an XML document as a tree.

and [4]:

   The root node is the root of the tree.

> it's possible to create new nodes within it, rather than creating a set

RTF nodes are not node-set nodes.

You're not creating node-set datatype nodes until you use
exsl:node-set() to turn the RTF into a node-set (or you use xsl:copy-of
to copy the RTF to the result tree).

About all you can do with an RTF as an RTF is use its string value.

> of references to nodes in the original document when @select is used.
> Then exsl:node-set() essentially acts like document(), correct? I think
> I was getting confused because I started out making copies of the nodes
> in the template content.

The result of exsl:node-set() has the same general structure as a
document in that it has one root node, but that root node could have
multiple element node children (unlike an XML document).

Regards,


Tony Graham.
======================================================================
Tony.Graham@xxxxxxxxxxxxxxxxxxxxxx   http://www.menteithconsulting.com

Menteith Consulting Ltd             Registered in Ireland - No. 428599
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
----------------------------------------------------------------------
Menteith Consulting -- Understanding how markup works
======================================================================

[1] http://www.w3.org/TR/xslt#section-Result-Tree-Fragments
[2] http://www.exslt.org/exsl/functions/node-set/index.html
[3] http://www.w3.org/TR/xpath#data-model
[4] http://www.w3.org/TR/xpath#root-node

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.