• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Experts of XML .... plz have a look... !

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all !
I want to extract information from the XML document depending on values of particular element between some range.. say get me the information where somedate (element) between date1 and date2 (typical SQL Scenario)
1) how do i write the xml-schema for this type of elements ? specifically i m interested in the type of this element.
2) How do i write the xpath query to compare dates..
3) What if my parameter values also contains time factor in some format say.. get me information for somedate (element) between '01-jan-2002 10:00' to '26-jan-2002 23:59'
How do i do it ???
Thanks in advance..
Badal
www.necoinfotech.com
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) How about dateTime:
yyyy-mm-ddThh:mm:ss
2) Unfortunately, there is no "date" datatype in Xpath. It knows only four:
1)boolean
2)number
3)string
4)node-set
so your xpath query will be no different from this for strings.
3. Something like (assuming your data are hidden in "dates" tag):
<xsl:copy-of select=".//dates[. > '2002-01-02 10:00' and . &lt; '2002-01-26 23:59']"/>
[ January 31, 2002: Message edited by: Mapraputa Is ]
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic