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 Please help in XPath to parse XML with namespace 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 "Please help in XPath to parse XML with namespace" Watch "Please help in XPath to parse XML with namespace" New topic
Author

Please help in XPath to parse XML with namespace

Abhijit Das
Ranch Hand

Joined: Sep 25, 2007
Posts: 156
hi,
I can not parse XML document having namespace in the root element.Is there any condition to parse a XML file with namespace by using XPath APIs?I have a .xml file with the following root element with namespace ( it is .xpdl file generated from BPMN).
e.g.

The Above file is not parsing. My coding is


But, once I change the attribute of <Package> element with only one type of attribute "xmlns".
It works fine.
Thanks in advance


Abhijit Das
SCJP 5.0 | SCWCD 1.5
 
Have you checked out Aspose?
 
subject: Please help in XPath to parse XML with namespace
 
It's not a secret anymore!