From the An XHTML + MathML + SVG Profile Specification
Only MathML and XLink namespace declarations are allowed on MathML
elements, and XHTML or SVG namespaces cannot be declared.
So in essence, @ErikDahlström is right about a new validation profile. However, one in the public domain already exist. http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd
It is missing the XLINK definition through, but we can easily add it.
The solution is rather wordy but that's the nature of XML.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"[
<!ENTITY % XLINK.xmlns "http://www.w3.org/1999/xlink" >
<!ENTITY % SVG.prefixed "IGNORE" >
<!ENTITY % XHTML.prefixed "INCLUDE" >
<!ENTITY % XHTML.prefix "xhtml" >
<!ENTITY % MATHML.module "IGNORE" >
]>
<svg version="1.1" id="denmark" viewBox="0 0 1280 800" preserveAspectRatio="xMidYMid slice"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<title>De mægtige vikinger</title>
<switch>
<foreignObject width="0" height="0">
<xhtml:link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</foreignObject>
</switch>
<script type="application/ecmascript" xlink:href="js/lib/svg.js"></script>
</svg>
The above will validate in W3C Validator. FINAL UPDATE: The W3C Validator will actually not validate the above since it says the xmlns
attribute doesn't exist. No browser will render the SVG if this is not set, so it's clearly a bug in the W3C Validator.
Notes
Since I couldn't find a DTD without MathML, and I don't need it, I simply opted for ignoring it. Hence: <!ENTITY % MATHML.module "IGNORE" >
The dtd I found with xhtml + math + svg doesn't have XLink (which we need to be able to add scripts), so it's included with: <!ENTITY % XLINK.xmlns "http://www.w3.org/1999/xlink" >
The favicon is working when using Firefox, Safari. It never worked in IE but I suspect that the graphic designer used pngs and not bitmaps. On Chrome and Safari this only works when not served locally.
Here is the temporary example:http://www.demægtigevikinger.dk/prototype/v0.5/ - site is no longer online