This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes namespace confusion with xPath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "namespace confusion with xPath" Watch "namespace confusion with xPath" New topic
Author

namespace confusion with xPath

Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Hi.
How to handle namespace in xPath with following excerpt. I am quite confused.
Here is the XPath statement:

Here are different versions of xml file with indication wheter it works or not:
Vs. 1: without namespace in root-element document and without Doctype. Works (gives return noteset and true.


Vs. 2: with namespace in document and without Doctype. Does not work. (gives return null/false).

Here's question: How should I change the xPath statement that it works with this kind of implicit/anonymous namespace (not correct name), you know that xmlns='http://www.lotus.com/dxl' stuff.

regards Axel
[ October 22, 2003: Message edited by: Axel Janssen ]
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
This FAQ with two examples might help:
http://bobcat.webappcabaret.net/javachina/faq/xpath_01.htm#xpath_Q15
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Thanks a lot.
Good luck in your job search.
Axel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: namespace confusion with xPath
 
Similar Threads
xPath and namespace problem
problem in XML Parsing using XPathAPI
XMLUnit and XPath problem
Please help in XPath to parse XML with namespace
Can I use an attribute default in a DTD to declare an XML namespace?