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

Re: xsltproc complains about xsl:sort

Subject: Re: xsltproc complains about xsl:sort
From: Ed_Owen@xxxxxxxxxxxxxxxxxxxx
Date: Tue, 3 Aug 2004 14:07:49 -0700
xsltproc sort
M. David,

Thanks for the explanations and suggestions. I've unraveled what was going
on:

(1) The xsltproc error messages were happening because xsltproc was taking
this line of the XSLT (note newlines and tabs):

      <xsl:for-each test="footest">
            <xsl:sort select="foo"/>

And seeing:

<xsl:for-each test="footext">[CR/LF][TAB]<xsl:sort select="foo"/>

The [CR/LF][TAB] is seen as a text node, and so therefore the <xsl:sort>
element is not the first child element of the <xsl:for-each>, and so
xsltproc complains.

This strikes me as a bit odd, because the root element is <xsl:stylesheet
... xmlspace="default">, so I'm not sure why it's trying to preserve the
whitespace (I thought "default" did NOT preserve whitespace). But that's
definitely what it is trying to do based on the -v log I recorded from
xsltproc.

Removing the [CR/LF][TAB] and putting the <xsl:sort> on the same line as
the <for-each> solved the problem.

(2) The duplications I was seeing were due to some newbie select="" syntax
I was using.

I had:

      select="/element1[predicate]/childelement1/childelement2[predicate]"

when I should have been using:

      select="/element1[predicate and
childelement1/childelement2[predicate]]"

My syntax was producing too many/duplicate matches for element1's.

thanks
Ed

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.