You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Enrico Brighi <br...@libero.it> on 2001/01/31 10:27:41 UTC

Big problem with xsl:sort

Hi,
     i'm using xsl:sort to order a set of ARTICLE on the DATE value.
Please, is there a way to maintain the order out of an apply-templates or
for-each block??

I need, for my document structure, that the order should be mantained in the
template of ARTICLE, that is:

<xsl:apply-templates select="ARTICLE">
    <xsl:sort data-type="number" select="DATE"/>
<xsl:apply-templates/>


and i've this template for viewing the articles by those positions:

<xsl:template select="ARTICLE[position() = 1]">
    <TR>
            ......
    </TR>
</xsl:template>

BUT....THE POSITION SELECTED BY THE TEMPLATE ISN'T THE "ORDERED" POSITION
BUT THE ORIGINAL POSITION IN MY FILE OF NEWS ARTICLE!!!! I'VE LOST THE
SORTING IMMEDIATELY AFTER THE xsl:apply-templates COMMAND!!!

TNK U

ENRICO






Re: Big problem with xsl:sort

Posted by Donald Ball <ba...@webslingerZ.com>.
This is a general XSLT question and is off topic here. you might ask on
the mulberrytech XSLT list.

- donald

On Wed, 31 Jan 2001, Enrico Brighi wrote:

> Hi,
>      i'm using xsl:sort to order a set of ARTICLE on the DATE value.
> Please, is there a way to maintain the order out of an apply-templates or
> for-each block??
>
> I need, for my document structure, that the order should be mantained in the
> template of ARTICLE, that is:
>
> <xsl:apply-templates select="ARTICLE">
>     <xsl:sort data-type="number" select="DATE"/>
> <xsl:apply-templates/>
>
>
> and i've this template for viewing the articles by those positions:
>
> <xsl:template select="ARTICLE[position() = 1]">
>     <TR>
>             ......
>     </TR>
> </xsl:template>
>
> BUT....THE POSITION SELECTED BY THE TEMPLATE ISN'T THE "ORDERED" POSITION
> BUT THE ORIGINAL POSITION IN MY FILE OF NEWS ARTICLE!!!! I'VE LOST THE
> SORTING IMMEDIATELY AFTER THE xsl:apply-templates COMMAND!!!
>
> TNK U
>
> ENRICO
>
>
>
>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>