[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsltproc complains about xsl: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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|