From: Sean O'Dell Date: 2002-05-16T03:19:58+09:00 Subject: Re: ANN: REXML 2.3.3 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 >>> >>> BCBB >>> >> >>CB >>B >> >> >>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.... > > > > > C > > > > B > > > > 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 B ....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: B 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