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

Applying templates to Result Tree Fragment

Subject: Applying templates to Result Tree Fragment
From: "James Lynn" <jiml@xxxxxxx>
Date: Mon, 2 Oct 2000 15:26:04 +0100
templates by lynn
Let's say I define a variable thus:
<xsl:variable name="somedata">
<NODE>
	<SUBNODE>data</SUBNODE>
	<MOREDATA>some more</MOREDATA>
</NODE>
<NODE>
	<SUBNODE>a different piece of data</SUBNODE>
	<MOREDATA>and some more</MOREDATA>
</NODE>
</xsl:variable>

so that $somedata contains the XML data as a result tree fragment.

Is it then permissible to do the following:

<xsl:apply-templates select="$somedata"/>

and have my stylesheet (which has match templates for the NODE SUBNODE and
MOREDATA elements) process the nodes from the RTF instead of from the source
XML document?

I ask because I've done this exact thing using the May release of the
microsoft parser and it worked beautifully, but when I tried the same
stylesheet with the July release this no longer worked (nothing was output
by the apply-templates call). I'm worried that what I'm trying to do
violates some subtle rule in the XSLT spec, but it could just as easily be a
bug in the MS release. I need to know which it is, because I'd like to
migrate to the newer MS releases, but I can't if this feature is impossible.

If it *is* disallowed by the XSLT spec, how would people recommend I achieve
the same result (i.e. including XML data in the same format as the source
document, and applying templates to it. I'd rather not use document() just
to keep it all inline (my feeling is there would be a significant
performance hit).

Any and all advice would be appreciated.

Jim Lynn.
http://www.h2g2.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.