You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Julian Reschke <ju...@gmx.de> on 2000/10/17 20:11:17 UTC
XMLSerializer in Xerces-J
Hi,
I am trying to use Xerces' XMLSerializer to write out a DOM, using:
FileWriter fos = new FileWriter( file );
org.apache.xml.serialize.XMLSerializer ser = new
org.apache.xml.serialize.XMLSerializer
(fos, new org.apache.xml.serialize.OutputFormat ("xml", this.encoding,
true));
ser.serialize( this.document );
This works fine, except that namespace information is dropped. The DOM is
created from scratch, and createDocument (in DOMImplementation) was used to
create a document element in a specific namespace (I verified that
dom.getDocumentElement().getNamespaceURI() displays the right namespace
name).
What am I missing?
Julian
Re: XMLSerializer in Xerces-J
Posted by Arnaud Le Hors <le...@us.ibm.com>.
Julian Reschke wrote:
>
> Hi,
>
> I am trying to use Xerces' XMLSerializer to write out a DOM, using:
>
> FileWriter fos = new FileWriter( file );
> org.apache.xml.serialize.XMLSerializer ser = new
> org.apache.xml.serialize.XMLSerializer
> (fos, new org.apache.xml.serialize.OutputFormat ("xml", this.encoding,
> true));
> ser.serialize( this.document );
>
> This works fine, except that namespace information is dropped. The DOM is
> created from scratch, and createDocument (in DOMImplementation) was used to
> create a document element in a specific namespace (I verified that
> dom.getDocumentElement().getNamespaceURI() displays the right namespace
> name).
>
> What am I missing?
Nothing. The serializer is broken and although many already have
reported the problem you're facing nobody has contributed any patch yet.
If you could do so, that'd be great!!
--
Arnaud Le Hors - IBM Cupertino, XML Technology Group