[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RE:
Guys,
At 06:10 AM 7/29/2003, Simon wrote: > <xsl:variable name="myxml" select="document('somefile.xml')"/> > > you would then perform transformations on it by refering to the variable > > e.g. > <xsl:value select="$myxml//test"/> > > would output the value of a <test/> element. Even in XSLT 1.0, the $myxml variable declared as above would be bound to a node set. All is fine; no extension element is necessary. This is the difference between <xsl:variable name="myxml" select="document('somefile.xml')"/> and <xsl:variable name="myxml"> <xsl:copy-of select="document('somefile.xml')"/> </xsl:variable> The second variable is bound to a result tree fragment (a *copy* of the original node set). > btw you will have to understand about RTF and using the common node-set extension function if you want to get any further doing stuff with this. > The function allows you to turn any RTF, such as the copy just described, into an honest-to-goodness node set. So it won't make any difference how it's declared. It'll also let you do things like <xsl:variable name="myRTF"> <xsl:apply-templates select="document('somefile.xml')"/> </xsl:variable> <xsl:variable name="myNodeSet" select="exslt:node-set($myRTF)"/> and then process the nodes in the variable as if they were a source document (even though they are themselves the result of a transform). This allows chaining or "pipelining" of transforms within a single stylesheet process. Powerful, if sometimes a bit tricky to debug.... Shouldn't this thread have a subject line? Cheers, Wendell
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|