From: firstname.lastname@example.org [mailto:email@example.com] 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