Re: XML namespaces on the Web

Krzysztof Maczyński wrote:
> Both on the Web and elsewhere there are circumstances warranting
> strict or lax parsing. This was already a highly debated point when XML
> was designed. Already then we knew that for dissenting opinions usually
> a good solution is to include both ways things can work and a switch.
> Having the experience of over 10 years, it's clear that the needs of
> both sides are valid and not going away [1]. Therefore I'd like to
> propose XML 1.2 with a pseudo-attribute parse accepting values strict
> and lax added to the XML and text declaration. strict would do what
> parsers currently do (unifying XML 1.0 Fifth Edition with XML 1.1 Second
> Edition in some sensible way) and lax would use an algorithm based on
> Anne van Kesteren's draft, but returning an Infoset.

This would have the unfortunate side effect of causing existing XML 1.0 
parsers encountering <?xml parse="lax"?> to throw a well-formedness 
error, thus losing all the benefits of backwards compatibility that the 
original XML5 proposal has.

> I think authoring (generating) content is the time at which the
> knowledge of which parsing algorithm will be desirable is usually
> best. When the pseudo-attribute is absent though, the processor can
> choose (possibly following a setting > of the user).

No, the parsing algorithm should be determined at parse time depending 
on the needs of the application.  A web browser, for example, would 
typically always want to use graceful error recovery for web content, 
like XHTML, SVG, etc.

Some browsers might choose to offer some sort of debug mode intended for 
authors that allows them to enable strict error handling, but such a 
feature should be controlled entirely by user preference, rather than 
something tied directly to the document itself.

Otherwise, we're likely to see some authors include the parse="strict" 
pseudo-attribute in their documents, and inadvertently leave it in 
there, potentially subjecting end users to otherwise avoidable YSoD 
errors (particularly in cases involving generated XML, as opposed to 
static, hand-authored XML files).

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Tuesday, 17 November 2009 17:10:35 UTC