Say we have generated a DOM as follows:
<Parent><Child><Name>John
Doe</Name><Gender>Male</Gender></Child>><Child><Name>John
Doe</Name><Gender>Male</Gender></Child></Parent>
As you can there is Node.TEXT_NODE for indentation such as "\n", "\t", or so
other than values for <Name> and <Gender> elements.
My question is that if there is any utility available to convert the
above DOM to "the following DOM with indentation" as follows:
<Parent>
<Child>
<Name>John Doe</Name>
<Gender>Male</Gender>
</Child>
<Child>
<Name>Jane Doe</Name>
<Gender>Female</Gender>
</Child>
</Parent>
If there is a utility class something like:
import org.w3c.dom.Document;
public class XMLUtil {
/** Convert the non-indented DOM to an indented DOM */
public Document covnertNonIndentedDOM2IndentedDOM(Document inboundXML) {
Document outboundXML = null;
// snip
return outboundXML;
}
}
will be nice to know. So it can be done by:
XMLUtil xmlUtil = new XMLUtil();
Document respXML = xmlUtil.covnertNonIndentedDOM2IndentedDOM(reqXML);
Any info on this subject are welcome and will be appreciated. Thank you.
Regards,
Pae
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]