Project

Profile

Help

Processer.writeXdmValue includes all ns's

Added by Anonymous about 15 years ago

Legacy ID: #6987312 Legacy Poster: David Lee (daldei)

In Processor public void writeXdmValue(XdmValue value, Destination destination) Serializes unused namespaces. For example if I create a document <a:x xmlns:a="http://a.com&quot;&gt;&lt;foo&gt;bar&lt;/foo&gt;&lt;/a:x> then do an xquery //foo Then use Processor.writeXdmValue the result in text is <foo xmlns:a="http://a.com&quot;&gt;bar&lt;/foo> Instead of what I would expect <foo>bar</foo> This is due to this line in writeXdmValue tree.append((Item)item.getUnderlyingValue(), 0, NodeInfo.ALL_NAMESPACES); If I write my own version of this method using instead tree.append((Item)item.getUnderlyingValue(), 0, NodeInfo.LOCAL_NAMESPACES); Then the result is as I expected. I'm not sure if this is a bug or 'as designed' -David


Please register to reply