XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Do you enjoy neighborhoods where every house looksthe same?



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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS