Re: [xml] Attribute indenting

On Mon, Apr 25, 2005 at 05:54:55PM +0200, Nicolas Mailhot wrote:

Is there any good reason not to indent properly attributes when xmllint is
invoked with --format ? When I say indenting I think about constructions

 <foo bar1="..."

which you see in all XML textbooks but can not achieve with most current
XML formaters.

  because for document with a lot of deep, lots of attributes and little
CDATA you could end up with document serialization many multiplied by a factor
or 2 or 3 easilly for no practical gain.

I ask this because someone told me last week that using more than one
attribute per element should be avoided because the way tools indent them
(inline) a human can not parse them easily (SIC) so one can not write
readable XML with attributes. And indeed I see that any XML file that uses

  I see no valid argument there.

namespace declarations (big fat attributes) is very difficult to read once
reformated by xmllint - the output is fine for elements but not much else.

  There is so many axis to the "formatting" of markup, than trying to
provide customization for each an every axis would just be insanely complex
and confusing APIs. The in-memory format is public, write your own serializer 
if you really need something very custom.


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]