xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] sorting titles w stopwords but w/o value in every title node


Subject: RE: [xsl] sorting titles w stopwords but w/o value in every title node
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 2 Sep 2004 12:55:54 +0100

>  <xsl:variable name="output">
>   <xsl:for-each select="//section-02">
>    <xsl:sort 
> select="exsl:node-set($sort-titles)/*[@doc-number = 
> current()/doc-number]"/>

If you're lucky, the optimizer will extract

   exsl:node-set($sort-titles)/*

as a subexpression that can be evaluated outside the loop. 

In case you're not so lucky, it would be better to put it in a variable:

<xsl:variable name="ref" select="exsl:node-set($sort-titles)/*"/>
<xsl:variable name="output">
   <xsl:for-each select="//section-02">
    <xsl:sort 
 select="$ref[@doc-number = current()/doc-number]"/>

Or even better, use a key.

Michael Kay


Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor