r8988 - spip/ecrire/inc

Author: esj@rezo.net
Date: 2007-04-05 18:29:46 +0200 (jeu, 05 avr 2007)
New Revision: 8988

Log:
Prise en charge du XML Name Space dans la validation. Vraisemblablement laxiste sur l'absence de du préfixe du Name Space, notamment dans les attributs, mais ça permet d'expérimenter en attendant d'y voir plus clair.

L'exemple XHTML+MATHML+SVG
ci-dessous dénonce correctement les 2 erreurs de validation annoncées.

{{{
<!DOCTYPE html 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">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>XHTML Hote</title>
  </head>
  <body>
<h1>Une formule MATHML</h1>
<math xmlns="http://www.w3.org/1998/Math/MathML">
    <apply>
  <eq/>
  <apply><abs/><ci> x </ci></apply>
  <piecewise>
   <piece>
          <apply><minus/><ci> x </ci></apply>
          <apply><lt/><ci> x </ci> <cn>0 </cn></apply>
   </piece>ceci est une erreur dans le MATHML
  <piece>
          <cn> 0 </cn>
          <apply><eq/><ci> x </ci> <cn> 0 </cn>
    </apply>
  </piece>
  <piece>
          <ci> x </ci>
          <apply><gt/><ci> x </ci> <cn> 0 </cn></apply>
  </piece>
    </piecewise>
    </apply>
  </math>
<h1>Un dessin SVG</h1>
    <svg:svg version="1.1"
      xmlns:svg="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink">
        <span style='color: blue'>Ceci est une erreur dans le SVG</span>
        <svg:ellipse rx="110" ry="130" fill='green' />
      <svg:rect x="7cm" y="3cm" width="3cm" height="4cm" fill="red" />
    </svg:svg>
  </body>
</html>
}}}

Modified:
   spip/ecrire/inc/valider_xml.php

Details: http://trac.rezo.net/trac/spip/changeset/8988