Subject: Re: [docbook] Tell me agian why I need mml:?
Hi Steven, On Sunday 06 November 2005 02:41, Steven T. Hatton wrote: > I'm a bit confused as to why I need to qualify the tags in a <math > xmlns='http://www.w3.org/1998/Math/MathML'/> element. My reading of > the XML Namespace recommendation suggests that the default namespace > within the element should be the MathML namespace, and MathML > components should dominate identical DocBook components. Is it simply > a case that this isn't a perfect world, and current implementations > don't behave as they should, or am I misunderstanding the XML > Recommendations? You are challenging one of the oddities of XML and DTD: namespaces. DTDs are old from the very beginning of SGML. XML and XML namespaces exists not so long ago. The problem with the two is simply that DTD doesn't know anything about namespaces. So if you define an element foo which belongs to a namespace, there are two possibilities: (1) <foo xmlns="http://www.example.com/foo" /> (2) <x:foo xmlns:x="http://www.example.com/foo" /> From a XML point of view both are the same, because they belong to the same namespace (the difference is just that one have a prefix and the other does not.) Unfortunatly, as DTDs doesn't know anything about namespaces, DTDs see different elements here. Therefor you must be very careful to have the correct prefix, although it is from a XML point of view not necessary. The DocBook MathML module uses the "mml" prefix. This is the reason why your MathML code must contain the this prefix as well. If you don't like this prefix, you can change it: <!DOCTYPE equation PUBLIC "-//OASIS//DTD DocBook MathML Module V1.0//EN" "http://www.oasis-open.org/docbook/xml/mathml/1.0/dbmathml.dtd" [ <!ENTITY mathml-prefix "mathml"> ]> <equation> <title>...</title> <mathml:math> <!-- Put here your MathML code here --> </mathml:math> </equation> Of couse, you can always switch to RELAX NG. This is a schema language that supports namespaces and that doesn't have this problems. Bye, Tom -- Thomas Schraitle