Hi,
I'm trying to serialize a DOM using the xalan package. I have a
problem with the XML declaration not getting printed. Here's a snippet
of code showing the initialization of the
org.apache.xalan.serialize.SerializerToXML:
Properties outputFormat =
OutputProperties.getDefaultMethodProperties(Method .XML);
outputFormat.put(OutputProperties.S_KEY_INDENT_AMO UNT, "3");
outputFormat.put(OutputKeys.INDENT, "yes");
outputFormat.put(OutputKeys.OMIT_XML_DECLARATION, "no");
serializer = new SerializerToXML();
serializer.setOutputFormat(outputFormat);
The indent & indent amount properties do work as I see proper
indentation in the serialization output. However the XML declaration
does not appear in the serialized output.
Can someone please help? I can't figure where to output that damn XML
header.