Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


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

From: Tony Graham <Tony.Graham@---------------------->
To:
Date: 11/1/2007 8:56:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent