• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

XPath for finding an XMLSubset for dates

 
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an XML ..


I wish to extract the records which are between 2004-6-03 13:40:49.0 to 2004-10-03 13:40:49.0 date .
I wish to do it using XSL.
I used this XPath ..//rec[field[1] >= '2004-06-03 13:40:49.0'][field[1] <= '2004-10-03 13:40:49.0'] But it returns me an empty node set.
What I am missing ... ?

Thanks
Dhiren
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used this XPath ..//rec[field[1] >= '2004-06-03 13:40:49.0'][field[1] <= '2004-10-03 13:40:49.0'] But it returns me an empty node set.
What I am missing ... ?

Try the XPath :

..//rec[field[1] >= '2004-06-03 13:40:49.0']|| ..//rec[field[1] <= '2004-10-03 13:40:49.0']

Let us know if this works.

- m
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
didnt work out.
Infact anywhere I use the <= or >= sign for date the records found are empty nodeset.
Seems like XSL is unable to do a date compare.

Thanks
Dhiren
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic