[oXygen-user] Oxygen Eclipse plugin XPath evaluator not handling default namespaces...
John O'Shea
Thu Sep 30 10:28:50 CDT 2004
Hi,
I've got an XML doc that looks like this:
<?xml version="1.0" ?>
<EXAMPLE_COMMIT_NOTICE xmlns="http://example.com/services/b2b"
xmlns:example="http://example.com/services/b2b">
<Partner_ID>abcdef</Partner_ID>
<File_Name>abcdef</File_Name>
<Transmission_Date>abcdef</Transmission_Date>
<Commit_Notice_Detail>
<Order_Number>abcdef</Order_Number>
<Partner_Web_Order_Number>abcdef</Partner_Web_Order_Number>
<Line_Number>abcdef</Line_Number>
<Product_ID>abcdef</Product_ID>
<Quantity_Committed>abcdef</Quantity_Committed>
<Committed_Ship_Date>abcdef</Committed_Ship_Date>
</Commit_Notice_Detail>
</EXAMPLE_COMMIT_NOTICE>
When editing in the Oxygen XML, if I choose the XPath Expression
evaluator and enter:
/example:EXAMPLE_COMMIT_NOTICE/example:Commit_Notice_Detail/example:Order_Number
then I get an error dialog back from the oXygen plugin:
"Exception ro.sync.goto.do
Prefix must resolve to a namespace: example"
despite the fact that the example prefix is correctly bound to a namespace.
I've tried various tricks to get an XPath query that can find elements
in this document but nothing will work. I've dropping the proxy of the
default namespace and trying
/:EXAMPLE_COMMIT_NOTICE/:Commit_Notice_Detail/:Order_Number but it gives
the same erri (with nothing after the 'Prefix must resolve to a
namespace: ' message.
Note, if I do something like:
<?xml version="1.0" ?>
<EXAMPLE_COMMIT_NOTICE xmlns="http://example.com/services/b2b"
xmlns:example="http://example.com/services/b2b">
<Partner_ID>abcdef</Partner_ID>
<File_Name>abcdef</File_Name>
<Transmission_Date>abcdef</Transmission_Date>
<Commit_Notice_Detail xmlns="">
^^^^^^^^
<Order_Number>abcdef</Order_Number>
<Partner_Web_Order_Number>abcdef</Partner_Web_Order_Number>
<Line_Number>abcdef</Line_Number>
<Product_ID>abcdef</Product_ID>
<Quantity_Committed>abcdef</Quantity_Committed>
<Committed_Ship_Date>abcdef</Committed_Ship_Date>
</Commit_Notice_Detail>
</EXAMPLE_COMMIT_NOTICE>
and then use a query string of '//Commit_Notice_Detail' it correctly
returns '/EXAMPLE_COMMIT_NOTICE[1]/Commit_Notice_Detail[1]'
However, that's of no use to me - all of the elements in the document
must be from the default or a named namespace.
Note the posting on the Oxygen message board at
http://www.oxygenxml.com/forum/viewtopic.php?p=21 suggests this approach
(proxying the default namespace) should work.
Can you let me know what I've missed, or is this a know fault with the
plugin (or Xalan)?????
More information about the oXygen-user
mailing list