File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Need help to retrieve a timestamp using specific identificationID Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Need help to retrieve a timestamp using specific identificationID" Watch "Need help to retrieve a timestamp using specific identificationID" New topic
Author

Need help to retrieve a timestamp using specific identificationID

Rama Krishna Ghanta
Ranch Hand

Joined: Nov 20, 2006
Posts: 59
My requirement is to develop a report and I have to get the elements from the xml file using xpath. I have attached an xml file for which I create a datasource for. Can someone help me with an Xpath expression to get the timestamp value for the IdentificationID = 2. If IdentificationID = 2 then ActivityCategoryText will surely be "Arrested". I mean, how would I get the value, 2008-11-02T19:08:00-05:00? Here is my xml instance. I tried to upload an xml file as an attachment. But I am not allowed to attach a file with .xml. So posting the xml code here.


Ram...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18653
    
    8

So what do you have so far? Can you find the nc:IdentificationID element whose value is "2"? Did you know that when you see "whose" or "which" in the XPath specification then you should probably be using a predicate? Are you confused by namespaces? We don't write code for people here, so a more specific question would be very helpful.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help to retrieve a timestamp using specific identificationID