[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Is this legal xpath usage?

Subject: Re: Is this legal xpath usage?
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 19 Apr 2001 08:23:16 +0100
trimdate
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)) &lt; 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)) &lt; 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.