Hello:

I am using XMLSerializer with OutputFormat to format
my XML into a string using this code:

    /* document contains a Document object */

    CharArrayWriter writer = new CharArrayWriter();
    OutputFormat outputFormat = new OutputFormat("xml","utf-8",true);
    XMLSerializer serializer = new XMLSerializer(writer,outputFormat);
    serializer.serialize(document);
    writer.close();

    /* writer.toString() gives me the XML formatted in a string */

When the text content of a tag is empty, I am getting
this in the output:
        
        <TagName/>

I would like to generate this output instead:
        <TagName></TagName>

Any ideas?

I know the first form is correct and conformant, but I don't control
the other side's parsing code.

Thanks,
        Neil

--
Neil Aggarwal, (214)986-3533, www.JAMMConsulting.com
FREE! Eliminate junk email and reclaim your inbox.
Visit http://www.spammilter.com for details.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to