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

RE: Microsoft msxml3.0 v. msxml4.0

Subject: RE: Microsoft msxml3.0 v. msxml4.0
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 21 Jun 2002 21:20:09 +0100
msxml3.0 download
> 
> Can anyone figure out why $row1 does not evaluate to a 
> nodeset? What do I need to do different about declaring row1?

xsl:variable with non-empty content creates a result tree fragment.

Why are you copying the nodes to create a new tree? This is a really
expensive operation. You only need to select the nodes:

<xsl:variable name="row1" 
   select="$items[position() &gt; 0 and position() &lt; 5]"/>

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 
> 
> This works fine in MSXML3.0 sp1
> 
> 
>        <xsl:template name="grid">
>                <xsl:param name="items"/>
>                <xsl:param name="URL"/>
> 
>                <xsl:variable name="row1"><xsl:copy-of 
> select="$items[position() &gt; 0 and position() &lt; 
> 5]"/></xsl:variable>
>                <xsl:variable name="row2"><xsl:copy-of 
> select="$items[position() &gt; 4 and position() &lt; 
> 9]"/></xsl:variable>
>                <xsl:variable name="row3"><xsl:copy-of 
> select="$items[position() &gt; 8 and position() &lt; 
> 13]"/></xsl:variable>
>                <xsl:variable name="row4"><xsl:copy-of 
> select="$items[position() &gt; 12 and position() &lt; 
> 17]"/></xsl:variable>
> 
> <!--   The following expression works -->
> 
> 
>                <xsl:for-each select="$items[position() &gt; 0 
> and position() &lt; 5]">
>                        <xsl:value-of select="@SKU"/><br/>
>                </xsl:for-each>
> 
> <!--   This one below does not work???? ::-->
> 
>                <xsl:for-each select="$row1">
>                        <xsl:value-of select="@SKU"/><br/>
>                </xsl:for-each>
> 
> <!--   <I>Expression must evaluate to a node-set. 
> --&gt;$row1&lt;--</I> -->
> 
>        </xsl:template>
> 
> 
> Sean Hayes
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.