File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes difference between rtf and nodeset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "difference between rtf and nodeset" Watch "difference between rtf and nodeset" New topic

difference between rtf and nodeset

Tina Desai
Ranch Hand

Joined: Mar 13, 2003
Posts: 365
Hi all,
What is the difference between Result Tree Fragment (RTF) and a nodeset?
My perception is RTF is a set of nodes in user defined tags like -
and nodeset is the set of nodes got from the input doc itself.
Is this correct?
Thanks in advance

Alongwith being a good coder, try to be a good professional as well!
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065
This is correct.
Result tree fragment is the fifth data type XSLT's adds to XPath's four data types (boolean, number, string and node-set). It is treated as a string by all XSLT elements except <xsl:copy-of>, which see it as a node-set. Practically it means that you cannot "generate" XML dynamically in your XSLT out of strings and then query it, it still be treated as string. You can only add your hand-made markup to the output.
The new version of XSLT specification (2.0) removed this limitation and the result tree fragment is now first class citizen - you can query it as a node-set.

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Tina Desai
Ranch Hand

Joined: Mar 13, 2003
Posts: 365
Oh.. great.. does that mean there will be no need to take such RTFs in a variable when we need to traverse through it?
Thank you
I agree. Here's the link:
subject: difference between rtf and nodeset
It's not a secret anymore!