Re: Request to publish HTML+RDFa (draft 3) as FPWD

On 22 Sep 2009, at 22:14, Jonas Sicking wrote:

> I think I found the code that extracts prefix mappings, and it appears
> that it uses method 3. So my question is, why is this more correct
> than any of the other 4 methods i proposed?


I think you'll probably find that they all use "none of the above".  
None of the five methods you outlined match the method suggested  
(though not required - any other technique that produced the same end  
result is allowed) by the RDFa Syntax recommendation.

The method suggested would be to check the current element for  
attributes whose first six characters match "xmlns:". No walking  
ancestor elements is needed if you follow the algorithm suggested by  
the recommendation.

Exactly how to find these attributes which match those six characters  
is left up to the developer of the implementation - the developer  
will choose whichever method is most appropriate for the environment  
the implementation is expected to be run on. In terms of the DOM,  
I've found looping through the Node.attributes collection and  
checking the name property of each to be an effective method. That's  
the method I've used in Javascript and in Perl (libxml).

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Received on Tuesday, 22 September 2009 21:35:48 UTC