Groups | Blog | Home
all groups > dotnet xml > may 2004 >

dotnet xml : XPath problem with dateTime strings comparison


Viktor Jevdokimov
5/14/2004 7:53:52 PM
Hello,

I've got an XML file saved from DataSet. One table has datetime column
(datatype - xs:dateTime). XML file fragment for example:

<Root>
<Element>2004-03-15T00:00:00.0000000+01:00</Element>
<Element>2004-03-16T00:00:00.0000000+01:00</Element>
<Element>2004-03-17T00:00:00.0000000+01:00</Element>
<Element>2004-03-18T00:00:00.0000000+01:00</Element>
</Root>

I'm trying to get MyXmlNodeList using
MyXmlDataDocument.DocumentElement.SelectNodes(MyXPathString) method, where
MyXPathString, for example, should look like:
"/Root/Element[DateFrom >= '2004-03-16T00:00:00.0000000+01:00']"

Problem: None of nodes are selected/returned if I use ">=" or "<="
comparison operators, but I could get a result using "=" operator.

Question: How to compare datetime strings?


Thank you,
Viktor

Yan Leshinsky
5/14/2004 7:55:44 PM
And use XmlDocument instead of XmlDataDocument
Yan

[quoted text, click to view]

Magnus
5/14/2004 10:49:57 PM
See the following article:
http://www.biglist.com/lists/xsl-list/archives/200203/msg00492.html

"Viktor Jevdokimov" <vjevdokimov@hotmail.com> skrev i meddelandet
news:uLy1VQdOEHA.2780@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

Viktor Jevdokimov
5/15/2004 11:21:57 AM
As I thought. Thanks.

[quoted text, click to view]

Oleg Tkachenko [MVP]
5/16/2004 9:59:55 AM
[quoted text, click to view]

Or even XPathDocument if you only need to query data, not edit.

--
Oleg Tkachenko [XML MVP]
AddThis Social Bookmark Button