Community
Participate
Working Groups
The XPath view won't pick up default namespace prefixes: Consider: <e1 xmlns="urn:x-hello:xpath"><e2/></e1> For XPath2, the expression "/e1" should then pick up the e1 element, as long as the prefix mappings are set up correctly. Only it doesn't, and that is the bug. Side story: For XPath1, however, this is not not the case, it is expressly forbidden: (from http://www.w3.org/TR/xpath/#node-tests ) Fom 2.3 Node Tests: [...] A QName in the node test is expanded into an expanded-name using the namespace declarations from the expression context [...] except that the default namespace declared with xmlns is not used: if the QName does not have a prefix, then the namespace URI is null. [...] So it would be really useful to include a fixed default prefix for the default namepace, i.e. "i.e. always map the default namespace to "default" or "df" so you can at least do //default:server without having to go edit the setup?" (from http://twitter.com/#!/maxandersen/status/78440623564275712 ) I'm suggesting '_' as the prefix.
Created attachment 197597 [details] Patch for this issue Simple enough patch - still need a test case
Hey Jesper, any chance of getting this patch committed to head and to the maintenance stream?
(In reply to comment #2) > Hey Jesper, any chance of getting this patch committed to head and to the > maintenance stream? Yep, there's a chance. I'll get it done in the next few hours.
Dave: I've committed and released the test and fix for HEAD, but I'd like your review.
Created attachment 202567 [details] Patch containing a test case Simple test case for this bug
* Explain why you believe this is a stop-ship defect: This bug makes a very plain and simple usage scenario unusable. * Is there a work-around? No workaround except changing the XML document and XPath expressions. * How has the fix been tested? Tested manually by me, and excercised by attached JUnit test case. * Give a brief technical overview. The XPath2 engine has an API for adding the default namespace, but it needs to be called. It wasn't. * Who has reviewed this fix? I've added David Carver for review. * What is the risk associated with this fix? Very small risk since the code change is so simple.
Oh, I forgot to add, the PMC review is for the Indigo service release, 3.3.1
Released for 3.3.x.