Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XPath expression to find minimum/earliest date-time?

From: "Zoe Hart" <zoe.hart@------.-----------.--->
To: NULL
Date: 9/5/2007 9:29:00 AM

I'm actually working with XSLT in BizTalk 2006, which unfortunately doesn't 
support XLST 2.0 with all its nice date-time functions. But I was able to 
write some scripting functions that do string comparisions, format my 
date-time values as sortable date-time strings, and call my custom min 
date-time functions from XSLT.

Thanks,
Zoe

"Martin Honnen" <mahotrash@y...> wrote in message 
news:OwSuXZv7HHA.3716@T......
> Zoe Hart wrote:
>
>> I've written a function to convert a date to number of ticks, but since
>> finding the minimum date involves comparing an individual date (or number 
>> of
>> ticks) to a node set, I'm not sure how to get the whole node set 
>> converted
>> to number of ticks in order for the comparison to work.
>>
>> Any suggestions?
>
> Can you use XSLT? I don't think pure XPath 1.0 suffices. You can do e.g.
>   number(translate(value, '-T:', ''))
> to get a number your could compare, not even needing a function to convert 
> to ticks but the problem with applying that function to a node-set with 
> your original minimum approach remains.
>
> XPath 2.0 could do it nicely, besides having xs:dateTime support for 
> comparison operators and the min functio I think you can even apply 
> functional expressions to node-sets as the last part of an XPath 
> expression so there you could do
>
> min(/test/order/item_info/item/somedata/value/xs:dateTime(.))
>
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent