No, there is no whitespace... just <tag></tag>... Here is the code I am 
using... maybe someone can point out my error if I've made one...

            StringWriter sw = new StringWriter();
            OutputFormat format;
            if (compact) format = OutputFormat.createCompactFormat();
            else format = OutputFormat.createPrettyPrint();
            format.setExpandEmptyElements(false);
            XMLWriter writer = new XMLWriter(sw, format);
            writer.write(doc);
            writer.close();
            String docStr = sw.toString();

Thanks,
Brian


James Strachan wrote:

>Just out of interest, there's no whitespace between the tags at all? So you
>get
>
><tag></tag>
>
>and not
>
><tag>
></tag>
>
>or <tag>  </tag>?
>
>James
>-------
>http://radio.weblogs.com/0112098/
>----- Original Message -----
>From: "Brian W. Young" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, September 05, 2002 10:26 PM
>Subject: [dom4j-user] setExpandEmptyElements
>
>
>  
>
>>I'm having trouble with OutputFormat.setExpandEmptyElements().  Seems
>>that whether I call with true, or false... I get the same results.... i.e.
>><tag></tag> instead of <tag/>
>>
>>What is even more strange is apparently my project used to default to
>><tag/>.... and I didn't change any of my code I think we did update to a
>>newer xerces.jar.... and now I get <tag></tag> no matter what I do.
>>
>>P.S. Yes I know both representations mean the same thing, effectively.
>> I'd still like to have it work correctly- can you point me in the right
>>direction?
>>
>>Thanks!!
>>
>>||
>>
>>
>>
>>-------------------------------------------------------
>>This sf.net email is sponsored by: OSDN - Tired of that same old
>>cell phone?  Get a new here for FREE!
>>https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
>>_______________________________________________
>>dom4j-user mailing list
>>[EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/dom4j-user
>>
>>    
>>
>
>__________________________________________________
>Do You Yahoo!?
>Everything you'll ever need on one web page
>from News and Sport to Email and Music Charts
>http://uk.my.yahoo.com
>
>
>
>  
>



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to