You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Scott Moore <Sc...@netDecide.com> on 2002/09/10 21:24:38 UTC

XML Serializer with namespace problem

In Xerces 2.0.1, when I used org.apache.xml.serialize.XMLSerializer, it
would automatically add namespace declarations when serializing subtrees.
This no longer works with 2.1 and is causing problems with our code.

For instance:

<test xmlns:foo="uri" foo:attr="blah">
	<hmm>dummy node</hmm>
	<namespace foo:a="a">
		<bb>hi</bb>
	</namespace>
</test>

With the above XML, serializing <namespace> in 2.0.1 looks like this:

<namespace xmlns:foo="uri" foo:a="a">
	<bb>hi</bb>
</namespace>


But with 2.1, it comes out as invalid XML without the namespace decl:

<namespace foo:a="a">
	<bb>hi</bb>
</namespace>



Is this a bug or by design?  Is there an easy fix?

Thanks,
Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org