Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this Xml:

 <dbo>
    <Id>8270</Id>
    <FormName>new</FormName>
    <City>new</City>
    <ClaimNo>899</ClaimNo>
    <FDate>20/12/2012 00:00:00</FDate>
    <Amount>544</Amount>
    <GroupId>0</GroupId>
    <UpLoadDate>20/12/2012 12:06:27</UpLoadDate>
  </dbo>
<dbo>
    <Id>8271</Id>
    <FormName>new</FormName>
    <City>new</City>
    <ClaimNo>899</ClaimNo>
    <FDate>20/12/2012 00:00:00</FDate>
    <Amount>544</Amount>
    <GroupId>0</GroupId>
    <UpLoadDate>20/12/2012 12:06:27</UpLoadDate>
  </dbo>
<dbo>
    <Id>8272</Id>
    <FormName>new</FormName>
    <City>new</City>
    <ClaimNo>899</ClaimNo>
    <FDate>20/12/2012 00:00:00</FDate>
    <Amount>544</Amount>
    <GroupId>0</GroupId>
    <UpLoadDate>20/12/2012 12:06:27</UpLoadDate>
  </dbo>


I want to select the "UpLoadDate" from "dateTime 1" to "dateTime 2".
What is the Xpath query to do this in c#??
Thanks.
Posted
Comments
Oleksandr Kulchytskyi 24-Dec-12 4:12am    
Ohhhh, Recently i have been observing such tendency that there are a lot of lazy people who write some questions with only one intent is to get code which would work properly , it's very frustrates ....
Try to do the best of yourself , and only then , in case of failure, ask a question...
engmebeed 24-Dec-12 4:14am    
I am not lazy
i have tried more and more and no code work, i write this code :
XmlNodeList UpLoadDate = xmlDoc.SelectNodes("//DocumentElement/dbo[UpLoadDate >='20/12/2012 12:06:27' and UpLoadDate <'26/12/2012 12:06:27']");
and this not work and so on, so i need your help all if you could.
Thanks at all.
Oleksandr Kulchytskyi 24-Dec-12 4:19am    
Sorry ,I had no purpose to hurt you... my approach is below , under your first comment

1 solution

No, we won't give you solution.. We can't work out for you like this.. You should try it by yourself.. If you got stuck somewhere, you can certainly come here.. But don't ask directly for code..
-Krunal R
 
Share this answer
 
Comments
engmebeed 24-Dec-12 4:11am    
i have tried more and more and no code work, i write this code :
XmlNodeList UpLoadDate = xmlDoc.SelectNodes("//DocumentElement/dbo[UpLoadDate >='20/12/2012 12:06:27' and UpLoadDate <'26/12/2012 12:06:27']");
and this not work and so on, so i need your help all if you could.
Thanks at all.
Oleksandr Kulchytskyi 24-Dec-12 4:18am    
It can be done purely bu using XPath...

xmlDoc.SelectNodes("//dbo[xs:date(./FDate@text()) > xs:date('given date') and myParameter[text()='given parameter']]")
engmebeed 24-Dec-12 4:37am    
this query doesn't work.
mbuyelo 18-Oct-21 2:23am    
Did you get this resolved? having a similar problem myself

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900