Oxygen Eclipse plugin XPath evaluator not handling default namespaces...

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)?????

John posted this message also at support@oxygenxml.com, below I include the reply to that message.
Dear John,
Thank you for your message. We are aware of this limitation with version 4.2 and it was already corrected in the current development stream. The problem is that it detects only the prefixes used to qualify some elements so if you write something like: <?xml version="1.0" ?> <example: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:EXAMPLE_COMMIT_NOTICE> then your XPath expression /example:EXAMPLE_COMMIT_NOTICE/example:Commit_Notice_Detail/example:Order_Nu mber should work. Best Regards, George <<< Best Regards, George ----- Original Message ----- From: "John O'Shea" <john.oshea@capeclear.com> To: <oxygen-user@oxygenxml.com> Sent: Thursday, September 30, 2004 6:28 PM Subject: [oXygen-user] Oxygen Eclipse plugin XPath evaluator not handling default namespaces...
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_Nu mber
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)????? _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (2)
-
George Cristian Bina
-
John O'Shea