Re: Can't validate against XHTML 1.1 plus MathML 2.0 with namespace prefixing

Michael Bowen wrote


> The MathML 2.0 recommendation [http://www.w3.org/TR/MathML2/chapter7.html]
> makes the following suggestion with regard to namespace prefixing. It
would
> be cool (for document validation purposes) if the XHTML 1.1 plus MathML
2.0
> DTD made allowance for this particular flavor of namespace prefixing (in
> particular, the validator currently chokes when it encounters an xmlns:m
> attribute inside the beginning of an <html> or <body> element).
>
> Is there any chance that the DTD could change (or at least spawn a mutated
> "transitional" version, as was done for HTML 4.0 to allow temporary use of
> deprecated elements) that would make validation possible for documents
that
> follow this particular recommendation?
>
> ===== <excerpt-from-recommendation> =====
>
> During the transitional period, in which some software may not be fully
> namespace-aware, a few conventional practices will ease compatibility
> problems:
> When using namespace prefixes with MathML markup, use m: as a conventional
> prefix for the MathML namespace. Using an explicit prefix is probably
safer
> for compatibility in current user agents.
>
> <snip>
>
> Examples.
> <body>
> ...
> <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
> <m:mrow>...<m:mrow>
> </m:math>
> ...
> </body>
>
> ===== </excerpt-from-recommendation> =====
>
> --MB
>

See MathML 2.0 recommendation Appendix A.3.

You can change the DOCTYPE-declaration in the source file to

a)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
 "./dtd/xhtml-math11-f.dtd"[
 <!ENTITY % MATHML.prefixed "INCLUDE" >
 <!ENTITY % MATHML.prefix "Michael" >
]>

and you can say

<Michael:math xmlns:Michael="http://www.w3.org/1998/Math/MathML">

or
b)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
 "./dtd/xhtml-math11-f.dtd"[
 <!ENTITY % MATHML.prefixed "INCLUDE" >
]>

and you can say

<m:math xmlns:m="http://www.w3.org/1998/Math/MathML">

Example:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
 "./dtd/xhtml-math11-f.dtd"[
 <!ENTITY % MATHML.prefixed "INCLUDE" >
 <!ENTITY % MATHML.prefix "Michael" >
]>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>
      PrefixTest.xml
    </title>
  </head>
  <body>
    <p>
      <Michael:math>
        <Michael:mfrac>
          <Michael:mn> 1 </Michael:mn>
          <Michael:mn> 2 </Michael:mn>
        </Michael:mfrac>
      </Michael:math>
    </p>
  </body>
</html>

You even then don't have to write the namespace declaration explicit in the
math-
or html-element because this is done implicit by the DTD .

Have a nice day
KB

Received on Monday, 1 April 2002 07:48:55 UTC