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

Re: xsl:for-each and variables

Subject: Re: xsl:for-each and variables
From: "Mark D. Anderson" <mda@xxxxxxxxxxxxxx>
Date: Tue, 14 Dec 1999 16:01:02 -0800
xsl for each variable
> (using XT from August running on NT using the windows executable)

i fixed your header for the latest spec:
<xsl:stylesheet
		version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns="http://www.w3.org/TR/REC-html40"
  >

i replaced this line:
 <xsl:variable name="temp">data/row</xsl:variable>
with this:
 <xsl:variable name="temp" select="data/row"/>

with latest (19991105) xt, i get:
<?xml version="1.0" encoding="utf-8"?>

     value is 1
     value is 2
     value is 3
     value is 4
     value is 1
     value is 2
     value is 3
     value is 4


with latest saxon, i get:
Error preparing style sheet
At xsl:for-each on line 12 of file:/d:/mda/projects/xmlhacks/xmlidl/test2.xsl: Variable temp has not been declared

which seems bogus.

the interesting distinction here is what this means:
<xsl:for-each select="$temp">

with your variable value, $temp is a string called "data/row", which is substituted in,
to get back the same string. and xt thinks a single string can't possibly
be converted to a node set.

with my variable value, $temp is a result tree fragment (right, everyone?)
which is then converted to a node-set for the for-each.

i think. from the thread currently going on about "node set fragments" [sic],
i obviously don't understand this stuff either.

-mda


 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.