Hi Neil,

thank you for that hint. An additional question:
As was pointed out by Michael Glavassevich one should switch from XMLSerializer 
to the standard JAXP Transformation API.
He points to 
        http://marc.theaimsgroup.com/?l=xalan-dev&m=107593381313807&w=2
and using this hint my code for serializing a string looks like

            // Use a Transformer for output
            TransformerFactory tFactory = TransformerFactory.newInstance();
            Transformer transformer = tFactory.newTransformer();

            DOMSource source = new DOMSource(doc);
            StringWriter myOutByteStream = new StringWriter();
            StreamResult result = new StreamResult(myOutByteStream);
            transformer.transform(source, result);       
            
            strResult = myOutByteStream.toString();

But here I am back to field one, there is no output of the namespace 
declarations.

Is there a solution for JAXP as well?
In transformer.setOutputProperty() I don't see something giving a similar 
effect to 

        serializer.setNamespaces(true);
        serializer.serialize(doc);

Dietrich



-----Original Message-----
From: Neil Delima [mailto:[EMAIL PROTECTED]
Sent: Montag, 13. September 2004 17:26
To: [EMAIL PROTECTED]
Subject: Re: Problem with serialization of a DOM with xerces 2.6.2


Tommy Eriksson <[EMAIL PROTECTED]> wrote on 09/13/2004 11:16:34 AM:

> Try 1:
>         OutputFormat format = new OutputFormat();
>         format.setLineSeparator(LineSeparator.Unix);
>         format.setIndenting(true);
>         format.setLineWidth(0);
>         format.setPreserveSpace(true);
>         XMLSerializer serializer = new XMLSerializer(sw, format);
>         serializer.asDOMSerializer();
>         serializer.serialize(doc);

Try
serializer.setNamespaces(true);
serializer.serialize(doc);


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to