I was intrigued by your question and started investigating, but I have to leave before I
came up with a concrete answer. However, I figured I'd toss out my two avenues of
investigation...
One is that the parser in dom4j is configurable. Take a look at the docs for
SaxReader:
http://dom4j.org/apidocs/org/dom4j/io/SAXReader.html
So, perhaps you can switch parsers and/or set the namespace aware property.
My other subject of investigation is jaxen (jaxen.org) which is the XPath implementation
that dom4j uses. For example, I found this comment:
"In XPath, there is no such thing as a 'default namespace'. The empty prefix always
resolves to the empty namespace URI. This method should return null for the empty prefix.
Similarly, the prefix "xml" always resolves to the URI
"http://www.w3.org/XML/1998/namespace"."
In the javadoc for NamespaceContext:
http://jaxen.org/apidocs/org/jaxen/NamespaceContext.html
I think that your "cleanest" solution would be to figure out how to use jaxen/dom4j to
interpret your XPaths across namespaces.
I wish I could be more helpful... and unfortunately this list is very quiet (at least on
the response end)... Edwin, Martin, you guys listening???
b
Andreas Andersson wrote:
Barbara Worwood wrote:
dbf.setNamespaceAware(false);
Couldn't dom4j be set to namespaceAware = false? with the
element("")-method it is just that.
Your trick would work but doesn't feal that "clean" :)
Thanks.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user