cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <KPiroum...@flagship.ru>
Subject Re: Number of last child
Date Thu, 01 Mar 2001 12:43:05 GMT
> On Thu, 1 Mar 2001, Piroumian, Konstantin wrote:
>
> >Try something like this:
> >
> >"//list/elem[position() = last()]/position()"
> >You don't need to put position() into [ and ] if you want to get its
value.
> >
> >Regards,
> >    Konstantin Piroumian.
>
> Results in:
>
> org.apache.xalan.xslt.XSLProcessorException: pattern =
'//tablehead/thcol[position() = last()]/position()'
>      Unknown nodetype: position
>
> A valid construct is:
>
> '//tablehead/thcol[position() = last()][position()]'
>
> which is the same as
> '//tablehead/thcol[last()]'
>
> and I get the content of the last node

Yes, that's correct if you want to get the content of the last node. I
thought that you wanted to get the value of the last index. I mean the index
of the last element and use it in a template.
To get the last index you can simply use: count(/list/item)


>
> Erwin
>
> --
> Erwin Burgstaller
> KNAPP Logistics Automation                  (ber@knapp.co.at / +43 316
495-618)
>
>
> ---------------------------------------------------------------------
> 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: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>

Mime
View raw message