It doesn't matter, except for display purposes.

Just a guess, but probably doc is produced by parsing a pretty-printed XML
text.  The parser may have an option to strip ignorable whitespace (e.g.
extra spaces between attributes inside start tags, whitespace in element
content where the DTD or XML Schema does not specify mixed content) which is
turned off.  In this case, Text nodes will be built for the ignorable
whitespace.  If you then serialize the same document the extraneous Text
nodes will be printed again, producing indented output.

On the other hand, when you build a Document directly by adding Element and
Attribute nodes, you're not putting in the extra text nodes, and would
probably not wish to be doing so -- they're a peculiar artifact of the DOM
interface.

Jeff

----- Original Message -----
From: "O'Neill, Niall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 5:57 AM
Subject: SOAP Response XML not indented



Hi,

I'm having a problem with the XML returned from a service. I have a method
that follows the Document methodName( Document doc ) pattern. It returns a
Document I build myself from a Java object using a custom writer that
appends
nodes to a document element as appropriate.

The resulting XML is not indented in my Axis client when it is returned, ie.
not pretty-printed. If I simply pass back the Document as it was passed in,
it is indented properly. Anyone any idea how to fix this - or does it not
matter except for display purposes?


Reply via email to