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

RE: Making groups of N elements --> Photo index

Subject: RE: Making groups of N elements --> Photo index
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 12 Jun 2002 23:11:30 +0100
yes foto
> Thank you for your advice about the result tree fragments. I 
> found that 
> feature very useful.
> 
> What is xx:node-set() ? Is it something portable?

It's an extension function that's available in nearly every XSLT
processor, though the namespace varies which makes it non-portable.
Several processors support the EXSLT namespace (see www.exslt.org) which
improves the situation.
> 
> I did it _without_ that function, as follows (comments welcome).
> 
> <xsl:variable name="allphotos"> <xsl:apply-templates 
> select="/fotos/foto" mode="identity"> <xsl:sort 
> order="ascending" select="@id" data-type="number" /> 
> </xsl:apply-templates> <foto id="100000000000" dummy="logo" 
> src="logo.gif" href="http://homepage" /> <foto 
> id="100000000001" dummy="yes" /> <foto id="100000000002" 
> dummy="yes" /> <foto id="100000000003" dummy="yes" /> <foto 
> id="100000000004" dummy="yes" /> <foto id="100000000005" 
> dummy="yes" /> <foto id="100000000006" dummy="yes" /> <foto 
> id="100000000007" dummy="yes" /> </xsl:variable>
> 
>   <xsl:for-each select="$allphotos/foto[(position() mod 8) = 
> 1 and not(@dummy='yes')]">

Then you're using a processor that implements the "implicit conversion
of result tree fragments to node-sets" offered by the XSLT 1.1 and XSLT
2.0 working drafts: this code isn't legal in XSLT 1.0. Which processor,
might I ask?

(Saxon allows this, provided your stylesheet specifies version="1.1" or
later. But some earlier versions of Saxon allowed it regardless).

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 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.