Hello,

I am writing the in-memory OMElement to an XML file as follows:

      import javax.xml.stream.XMLOutputFactory;
      import javax.xml.stream.XMLStreamWriter;

      public static void omToStream(FileOutputStream outputStream,
                  OMElement omElement) throws Exception {
            XMLOutputFactory xof = XMLOutputFactory.newInstance();
            XMLStreamWriter writer =
xof.createXMLStreamWriter(outputStream);
            omElement.serialize(writer);
      }

The output XML file generated out of this loses all indentation and new
lines. All the XML tags and values appear on the same line.

The OMOutputFormat does not seem to allow for setting the indentation
property.

I would appreciate any help in this regard.

Thanks,
Best regards,
Rajalakshmi Iyer


Reply via email to