This is working fine for me.
I wonder
(a) what DOM implementation you are using (I tested on Xerces)
(b) how are you actually reading the DOM, that leads you to the conclusion the namespaces are absent?
(c) how are you invoking the query?
Michael Kay

From: [] On Behalf Of Dueck, Brian
Sent: 04 March 2005 14:02
Subject: [saxon] DOMResult stripping namespaces from root element?


I'm getting some strange behaviour related to namespaces when getting results using a DOMResult vs a StreamResult.

To elaborate, I'm using Saxon8B to process some a simple Xquery expressions using and returning the results as a DOMResult. When I do this, none of the namespace declarations from the root element of my returned documented are available when I call DOMResult.getNode(). However if I change from DOMResult to StreamResult and serialize this out to System.out (or whatever) I see them just fine.

Is this behaviour expected?

To reproduce this, just try passing the following XML document (no special xquery syntax at all here in this test case) to

<soap:Envelope xmlns:mrns0=""        xmlns:soap="" xmlns:soapenc=""        xmlns:xsi="">

        <soap:Body soap:encodingStyle="">
                        <username xsi:type="soapenc:string">junk_user_name</username>

Using DOMResult in my case is *really* preferable as the results of the xquery run need to be passed to another component that is expecting a dom node. I don't really want to have to reparse the serialized xml available from StreamResult back into a DOM to avoid the performance hit.

Any, all, help is appreciated.



Discover the Power of MetaSolv
Subscribe to our Company Newsletter