Re: Using RELAX NG in XHTML 2.0

Karl Ove Hufthammer <karl@huftis.org> wrote:

> I agree. Requiring DTD validity to be a conforming XHTML document
> means that we can have two canonically equivalent XHTML documents,
> where one is valid (and conforming), and the other is not.
> 
> Example:
> 
> Document 1:
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xml:lang="en-GB">...</html>
> 
> Document 2:
> <prefix:html xmlns:prefix="http://www.w3.org/1999/xhtml"
>              xml:lang="en-GB">...</html>
> 
> These are equivalent, but only the first would be valid XHTML 1.0.

Well, to that extent it's possible with modular DTD like XHTML 1.1, e.g.

Document 1:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xml:lang="en-GB">...</html>

Document 2:

<!DOCTYPE prefix:html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
<!ENTITY % NS.prefixed "INCLUDE">
<!ENTITY % XHTML.prefix "prefix">
]>
<prefix:html xmlns:prefix="http://www.w3.org/1999/xhtml"
             xml:lang="en-GB">...</prefix:html>

and both can be valid.  Whatever it would end up, the XHTML 2.0 DTD
will also include the same facility.

Of course this parameter entity trick is messy, and will quickly
become unmanageable to most authors, especially for "hybrid"
document types.

An almost unknown fact is that the XHTML+MathML+SVG DTD [9] can
manage 23 different combination of various profiles of
XHTML/MathML/SVG with just one DTD driver through parameter entity
tricks, but I don't think sane people should bother with that.
It's certainly an over-engineering, the editor must be crazy.
And despite such insane effort, there are certain things that
DTD can't manage [10].

Compared to this monstrous DTD driver full of parameter entity
tricks, an XHTML2+MathML+SVG driver in RELAX NG would be just
like this:

    http://www.w3.org/People/mimasa/test/schemas/rng/xhtml2-math-svg.rng

And it's free from namespace limitations.  I would be very surprised
if anyone find DTD version easier to understand.

[9] http://www.w3.org/TR/2002/WD-XHTMLplusMathMLplusSVG-20020809/#dtd
[10] http://www.w3.org/TR/2002/WD-XHTMLplusMathMLplusSVG-20020809/#bugs

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium

Received on Thursday, 15 May 2003 05:56:22 UTC