xsl-list
[Top] [All Lists]

[xsl] xsl:perform-sort sequence problem

2007-10-22 04:06:44
Dear Community

I am using SaxonB 8.9 and I have the following xsl:perform-sort/sequence
problem.

<xsl:variable name="data">
        <item id="1">
                <departure date="2007-10-22">
                        <returning date="2007-10-23"/>
                        <returning date="2007-10-24"/>
                </departure>
        </item>
        <item id="2">
                <departure date="2007-10-22">
                        <returning date="2007-10-22"/>
                        <returning date="2007-10-24"/>
                </departure>
        </item>
</xsl:variable>

*** OK-Case: 
When I run the following statements I get an expected result of:

<xsl:variable name="result"
select="distinct-values($data/item/departure[(_at_)date eq
'2007-10-22']/returning/@date)"/> <xsl:value-of select="count($result)"/>
<xsl:value-of select="$result" separator=", "/>

=> 3
=> 2007-10-23,2007-10-24,2007-10-22


*** ??-Case: 
When I try to sort the same sequence the distinct-values become one single
string:

<xsl:variable name="result">
        <xsl:perform-sort 
select="distinct-values($data/item/departure[(_at_)date
eq '2007-10-22']/returning/@date)">
                <xsl:sort/>
        </xsl:perform-sort>
</xsl:variable>
<xsl:value-of select="count($result)"/>
<xsl:value-of select="$result" separator=", "/>

=> 1
=> 2007-10-22 2007-10-23 2007-10-24

Can any body please helping me to clarify my misunderstanding of the
xsl:perform-sort.

Many thanks in advance
Raffaele

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>