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

Re: Newbie question on XSL transformations: multiple

Subject: Re: Newbie question on XSL transformations: multiple sorts on element attributes
From: Owen Rees <owen.rees@xxxxxx>
Date: Wed, 07 Feb 2007 13:39:46 +0000
Re:  Newbie question on XSL transformations: multiple
--On Tuesday, February 06, 2007 16:40:58 -0800 Rob Newman wrote:

You have got the point - your summary is correct.
Unfortunately that first sort (1) causes xsltproc to seg-fault again. I
will keep trying to figure it out.

This, which incorporates Abel's suggestions and a wrapper to handle the example input, works for me with xsltproc on Linux giving the result you are looking for with the larger example as input.


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">

<dataloggerlist>
<xsl:apply-templates select="pfarr/pfarr/pfarr">
<xsl:sort select="pfstring[@name = 'dlt']" data-type="number" order="descending"/>
<xsl:sort select="@name"/>
</xsl:apply-templates>
</dataloggerlist>
</xsl:template>


   <xsl:template match="pfarr">
       <datalogger name="{@name}">
           <xsl:apply-templates select="pfstring"/>
       </datalogger>
   </xsl:template>

   <xsl:template match="pfstring">
       <param id="{@name}">
           <xsl:value-of select="."/>
       </param>
   </xsl:template>

</xsl:stylesheet>

--
Owen Rees
Hewlett Packard Laboratories, Bristol, UK

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.