This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Is this legal xpath usage?
- To: Patrick Moore <patrickm at rioport dot com>
- Subject: Re: [xsl] Is this legal xpath usage?
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Thu, 19 Apr 2001 08:23:16 +0100
- CC: "Xsl List (E-mail)" <xsl-list at lists dot mulberrytech dot com>
- Organization: Jeni Tennison Consulting Ltd
- References: <19590EC9B05DD4118ECE00D0B72065FCB8A756@sj-mail-01.rioport.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Patrick,
> I expect the external function jString:compareTo() to be
> called for each TRACK Element. It is called only once for the
> first TRACK.
>
> <xsl:template match="/" >
> <xsl:message>Filtering tracks earlier than
> <xsl:value-of select="$trimDate" /></xsl:message>
> <PRODUCT_LIST PACKAGER="DWS" >
> <xsl:apply-templates
> select="PRODUCT_LIST/PRODUCT[jString:compareTo($trimDate,
> rioport:formatDate(./PRODUCT_DETAILS/TRACK/LAST_UPDATE)) < 0]" />
> </PRODUCT_LIST>
> </xsl:template>
You're passing a node set consisting of all the LAST_UPDATE elements
to the rioport:formatDate() extension function. I have no idea how
that extension function works, but I suspect that it takes the first
node from that node set and returns a string, rather than formatting
all of them and returning a node set.
I think what you probably want is:
PRODUCT_LIST/PRODUCT
[PRODUCT_DETAILS/TRACK
[jString:compareTo($trimDate,
rioport:formatDate(LAST_UPDATE)) < 0]]
This applies templates to:
the PRODUCT elements that are children of the PRODUCT_LIST element
that is a child of the current node
where there is a TRACK element that is a child of the
PRODUCT_DETAILS element that is a child of the PRODUCT element
for which the result of comparing the $trimDate to the
formatted value of the LAST_UPDATE child of the TRACK element
is less than 0
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list