From: Michael Kay [mailto:firstname.lastname@example.org]
Sent: March 4, 2005 11:25
Subject: RE: [saxon] DOMResult stripping namespaces from root element?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 Kayhttp://www.saxonica.com/
From: email@example.com [mailto:firstname.lastname@example.org] 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 XQueryExpression.run() 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 XQueryExpression.run():
<soap:Envelope xmlns:mrns0="http://yahoouserping.webservice.allesta.org" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
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
Discover the Power of MetaSolvSubscribe to our Company Newsletter