You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Nestel, Frank" <fr...@coi.de> on 2000/08/16 17:38:02 UTC

Sorting numbers, two questions

Hi,

I have two questions on sorting:

1. I have a file here with numbers 1,3 and 1,5 etc.
That is, in Germany we use "," where Americans use ".".
I thought when I specify this as default decimal-format,
I could sort by this elements text as numbers. I doesn't 
work. I guess teh xsl:decimal-format is for the transformation
number to string. When the numbers do not contain a decimal 
separator the clause

	<xsl:sort select="WERT[$SORT]" data-type="number"/>

worked nicely.

2. Now I tried a workaround and filtered the input to
have an extra attribute "ORDER" at the above element, but
somehow I fail to order by an attribute (either the 
attribute does not exist or Xerces crashes with a long
dump. I tried to use clauses like

	<xsl:sort select="WERT[$SORT]/@ORDER" data-type="number"/>
	<xsl:sort select="WERT[$SORT]/attribute::ORDER" data-type="number"/>

Anyway I would prefere if I had not to filter the input file.

Puzzled again, any help?

Thank
by Frank