Re: [xml] Attribute indenting

On Jeu 28 avril 2005 14:27, Daniel Veillard a écrit :
On Thu, Apr 28, 2005 at 02:11:10PM +0200, Nicolas Mailhot wrote:
  There is so many axis to the "formatting" of markup, than trying to
provide customization for each an every axis would just be insanely
and confusing APIs. The in-memory format is public, write your own
if you really need something very custom.

It's not about doing something very custom. Since --format is useful
when a human reads the output (tools do not need the pretty indenting) I
assumed its aim was to produce code as human-readable as possible, ie
the same tricks as in XML reference books.

I don't see the point of indenting a document at all if a large part of
its contents (attributes) is still lumped together. It does not take a
of attributes to get line wrapping mess - it's a general case.

  user 1 wants

<doc><a foo="1" bar="2"/></doc>

  now do man indent, and count the options.

Well, I doubt any user wants

<foo xmlns:first="long uri sqlrvnLZ NQLZTJQLTJBLERLZJEL
VJZELJZLRBLZREVLZERVLajzlrjalzrvjlazekjlaz" xmlns:second="long uri 2
q;sfdv kghb elrh lerhylzreyjnlerylerjlertlz" xmlns:third="long uri 3 ljsdg
hlberjynlsry ejnlrt kjnmdrgnmfd,hnmr"/>

(unfortunately it's real difficult to type inline in anything except an
xml parser)

And you'll note your argument is somehow unfair - one of your example
shows no indenting at the element level though it didn't stop xmllint
(like most other tools) indenting them


Nicolas Mailhot

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