David Alan Black wrote:

> Hi --
> 
> On Thu, 16 May 2002, Rich Kilmer wrote:
> 
> 
>>>From: Sean Russell [mailto:ser / germane-software.com]
>>>
>>>How do you want
>>>
>>>  <a><b>B<c>C</c>B</b><b>B</b></a>
>>>
>><a>
>><b><c>C</c>B</b>
>><b>B</b>
>></a>
>>
>>Rule:  If all there is between tags is pure white space and sub-tags use
>>CR otherwise, don't change the formatting.
>>
>>Thoughts?
>>
> 
> My feeling is that if you're doing pretty-printing, then you've
> already decided to mess with the whitespace (based on what you expect
> the processors to do).  So, at the other extreme....
> 
> <a>
>    <b>
>       <c>
>          C
>       </c>
>    </b>
>    <b>
>       B
>    </b>
> </a>
> 
> which looks weird because the element names and content are all so
> short :-)  but that kind of layout I find more helpful in the ways I
> want pretty-printing to be helpful.


Yeah, but there's a difference between whitespace in parental elements 
and whitespace in elements with just data and no children.  It's not too 
common in config/structured-data-type XML to see data in an element with 
children.  Here's an example:

<a>
     A
     <b>
         B
     </b>
</a>

....I don't see that sort of thing happening much, except for stuff like 
XHTML or AbiWord text-formatting-type-XML.  Usually it's more like:

<a>
     <b>B</b>
</a>

I've done pretty printing for XML, and my rule was always: use indents 
and add newlines unless the element has no children, then strip off 
surrounding whitespace and just indent.

When it comes to formatted text where you WOULD see lots of data mixed 
with child elements, pretty printing would be suicide anyway.  Pretty 
printing is mainly for config files and such where you would see a lot 
of data mixed with children in the same element.

	Sean