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

Re: RE:

Subject: Re: RE:
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 29 Jul 2003 16:16:02 -0400
name variable is not declared.
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.

I thought this thing was not working with XSL 1.0 since the variable would
only contain text, and not a node-set.

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.
>

Could you please elaborate a little bit more on that point. Just reading the
EXSLT doc was not enough for me to understand the use of the new node-set
function.

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


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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



Current Thread
  • RE:, (continued)
    • cknell - Mon, 28 Jul 2003 07:05:32 -0400 (EDT)
    • Peter_Ivan - Mon, 28 Jul 2003 07:46:52 -0400 (EDT)
    • Jim Fuller - Tue, 29 Jul 2003 05:36:00 -0400 (EDT)
      • Simon Bretin - Tue, 29 Jul 2003 06:15:29 -0400 (EDT)
        • Wendell Piez - Wed, 30 Jul 2003 11:57:30 -0400 (EDT) <=

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.