[Home] [By Thread] [By Date] [Recent Entries]

  • From: Philip Fearon <pgfearo@g...>
  • To: liam@w...
  • Date: Sun, 21 Aug 2011 14:30:49 +0100

On Sun, Aug 21, 2011 at 3:28 AM, Liam R E Quin <liam@w...> wrote:

>>  To complement this, editors should have a capability to
>> safely strip such indentation characters when encountered (the reverse
>> of what pretty-print formatters achieve) in external sources.
>
> You can only do that in general with a schema (e.g. a DTD or XSD schema)
> of course.

The indentation characters found in formatted XML, though often
inconsistent (as they often are in examples found online - even in W3C
documents - not a criticism just an observation), can still provide
some useful clues as to the true purpose of leading whitespace
characters.

A crude  example of how patterns in leading whitespace can provide
clues as to its purpose:

....<abc>
......<pre-x>
...Its evident that this block of text should have the
...............whitespace preserved because it's inconsistent
...with previous padding and the XML content
......</pre-x>
...</abc>

Granted, the trimming will never be 100% safe, but I would argue that,
without a schema or configuration settings, its possible to trim
leading whitespace characters much more safely than pretty-print (even
in the leading XML tools) inserts them.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member