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 2001/10/11 16:10:39 UTC
Serializing Namespaces
When I use the following code to serialize the DOM, it does not include
namespace declarations. How do I turn that on?
public String toString()
{
try
{
Document doc = getDocument();
OutputFormat format = new OutputFormat(doc);
StringWriter stringOut = new StringWriter();
XMLSerializer serial = new XMLSerializer(stringOut, format);
serial.asDOMSerializer();
serial.serialize(doc.getDocumentElement());
return stringOut.toString();
}
catch (Exception e)
{
return e.toString();
}
}
Thanks for any help,
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org