Re: rdfa parsing problem

Ivan Herman wrote:
> Meri Kovach wrote:
>>  <table>
>>     <tr>
>>     <span about="#2105555" typeof="foaf:Person">
>>        <td>1</td>
>>        <td><span property="foaf:firstName">Meri</span></td>
>>        <td><span property="foaf:familyName">Kovac</span></td>
>>    </span>
>>    </tr>
>>  </table>
> [...]
> The way the distiller works is that if hits
> an XML (not XHTML!) error, it then switches (if allowed in the command
> arguments) to an HTML5 parser and attempts to run the code through that
> one, too. I guess (but I do not know) that the HTML5 parser attempts to
>   make some sense in the erroneous code and I would presume it will
> simply remove the <span> element from the DOM tree it produces.

That guess is almost right - with invalid input like this, the HTML5 
parser moves the <span> to just before the <table>, so it's equivalent to:

   <span about="#2105555" typeof="foaf:Person"></span>
   <table>
     <tr>
       <td>1</td>
       ...
     </tr>
   </table>

(You can test how html5lib parses HTML into a DOM tree using 
<http://james.html5.org/parsetree.html>)

-- 
Philip Taylor
pjt47@cam.ac.uk

Received on Friday, 22 May 2009 17:21:21 UTC