This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

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.
 
Have you checked out Aspose?
 
subject: Need help to retrieve a timestamp using specific identificationID
 
It's not a secret anymore!