XPath and timestamps

Posted on 2013-10-11
Medium Priority
Last Modified: 2013-10-12
I want to create an XML with timestamps for each element, like this:
<antony last-modified:"2013/10/09 01:31:33"> green </antony>
<marcus last-modified:"2013/10/11 15:34:33"> yellow </marcus>
<john last-modified:"2013/10/12 12:33:21"> black </john>

how can I extract with an XPATH 1.0 (MSXML library) all and only the elements which last-modified attribute has a timestamp value more recent than for example "2013/10/10 12:00:00"?
Question by:lucavilla
  • 3
LVL 60

Accepted Solution

Geert Bormans earned 2000 total points
ID: 39567307
//*[number(translate(@last-modified , '/ :', '')) > 20131010120000]
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 2000 total points
ID: 39567308
of course you can do the translate function on the compare string as well
//*[number(translate(@last-modified , '/ :', '')) > number(translate('2013/10/10 12:00:00' , '/ :', '')) ]

Author Closing Comment

ID: 39567814
genius  :)
LVL 60

Expert Comment

by:Geert Bormans
ID: 39567962

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Watch the video to know how one can repair corrupt Exchange OST file effortlessly and convert OST emails to MS Outlook PST file format by using Kernel for OST to PST converter tool. It can convert OST to MSG, MBOX, EML to access them. It can migrate…
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…

619 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question