How to do things smarter? Use NVDL!

Now the same schema (XHTML with embedded RDF, SVG and MathML) expressed using NVDL. It is so simple that the complete source code can even be shown on one slide.

Example 1. NVDL Script

<rules startMode="root">
  <mode name="root">
    <namespace ns="http://www.w3.org/1999/xhtml">
      <validate schema="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <context path="head" useMode="head"/>
        <context path="div|li|p...all block level elements" 
                 useMode="block_inline"/>
        <context path="a|em|span|...all inline elements" 
                 useMode="block_inline"/>
      </validate>
    </namespace>
  </mode>
  <mode name="block_inline">
    <namespace ns="http://www.w3.org/2000/svg">
      <validate schema="http://www.w3.org/TR/2002/SVG.xsd"/>
    </namespace>
    <namespace ns="http://www.w3.org/1998/Math/MathML">
      <validate schema="http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd"/>
    </namespace>
  </mode>
  <mode name="head">
    <namespace ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <validate schema="http://www.w3.org/2000/07/rdf.xsd" useMode="attach"/>
    </namespace>
  </mode>
  <mode name="attach">
    <anyNamespace>
      <attach/>
    </anyNamespace>
  </mode>
</rules>

We will explain this NVDL definition in detail later.