[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] Do you enjoy neighborhoods where every house looksthe same?
- From: Lauren Wood <lauren@textuality.com>
- To: xml-dev@lists.xml.org
- Date: Wed, 28 Aug 2013 10:23:59 -0700
On 28-Aug-13 8:57 AM, Jeremy H. Griffith wrote:
> The idea is that if the parser can tell what is missing
> or incorrect, and correct it, it will do so, warn you,
> and proceed. This is John Cowan's idea in the MicroXML
> spec. So for example if you have:
>
> <p>This is <b>bold.</p>
>
> the parser can reasonably guess you meant:
>
> <p>This is <b>bold.</b></p>
>
> Or if the character after the equals in an attribute
> is not a quote, it can supply one. There are quite a
> few places the parser can make a reasonable guess.
> Like, ",p>" might have been meant to be "<p>", with
> the Shift key not in sync for the first character (a
> personal favorite typo for me ;-).
The hard part with these fixes is knowing when to stop. The law of
diminishing returns kicks in fairly quickly on error conditions,
especially when the schema isn't constrained. For example, it's much
easier to correctly correct the missing end tags when the schema is
constrained (e.g., you at least know which elements are meant to be
empty, and which not). In my experience if your parser makes the wrong
choice and therefore 'corrects' the wrong thing, or corrects it in the
wrong way, the resulting mess can be difficult to fix properly. Of
course, depending on your downstream processing, that may or may not matter.
Lauren
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]