SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    shared namespaces won't validate

    Hi everyone, long time lurker, and I've started playing around with xhtml on my server now. Namely mathML and SVG, and I've gotten them to work just fine, it's that they _will not validate_ and I'm losing it. I've spent several hours looking for a solution the web and this and other forums. Here's the url http://www.vertexmode.net/xhtml/ and here is the code
    HTML Code:
    <!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" xmlns:math="http://www.w3.org/1998/Math/MathML" xml:lang="en">
    <head>
      <title>XHTML FTW!</title>
    </head>
    
    <body>
    <p>Validator does not like the xmlns attribute in either the html tag or any others for that matter.  It clearly works, so is it impossible to validate svg and matML? I'm serving as application/xhtml+xml, what is wrong?. note: doctype is only in so it doesn't try to validate as xml. </p>
    <svg width="300" height="300" xmlns="http://www.w3.org/2000/svg">
      <defs>
    	<filter id="Gaussian_Blur">
    	  <feGaussianBlur in="SourceGraphic" stdDeviation="3" />
    	</filter>
    	
    	<linearGradient id="orange_red" x1="0%" y1="0%" x2="100%" y2="0%">
    	  <stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1" />
    	  <stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1" />
    	</linearGradient>
      </defs>
    
      <rect width="300" height="100" style="fill:url(#orange_red);stroke-width:3;stroke:rgb(0,0,0)" />
    </svg>
    <br />
    <math:math>
      <math:mrow>
       <math:msup>
         <math:mfenced>
           <math:mrow>
             <math:mi>a</math:mi>
             <math:mo>+</math:mo>
             <math:mi>b</math:mi>
           </math:mrow>
         </math:mfenced>
         <math:mn>2</math:mn>
       </math:msup>
     </math:mrow>
    </math:math>
    </body>
    </html>
    Is this something that needs to be decalred in a DTD? Anyhow thanks in advance.

  2. #2
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Forget about DTDs. DTDs don't support namespaces. You can even drop the doctype declaration -- XML will get standards mode in browsers anyway.

    RELAX NG is a much better schema language than DTDs in several ways. There's an online validator for that and it has a preset for XHTML+SVG+MathML.
    Simon Pieters

  3. #3
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Validator

    Awesome thanks.

    I knew about the doctype, but I just had it in there so w3 validator wouldn't flip out. I seem to be liking the w3c less and less now

    Seems to validate fine now.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •