[whatwg] foreign attributes Re: several messages about XML syntax and HTML5

Ian Hickson ian at hixie.ch
Tue Dec 5 15:02:12 PST 2006


On Tue, 5 Dec 2006, Elias Torres wrote:
> 
>    <p class="ibm-order">
>      <span property="ibm-customer">
>       <span property="ex-name">Ian Hickson</span>
>       (<span property="acme-id">95237032895</span>)
>      </span>
>      has purchased a
>      <span property="ibm-part">
>       <span property="ex-name">Widget x12</span>
>       (part ID <span class="acme-id">295250X12</span>)
>      </span>
>     </p>
>     <p property="ibm-order ibm-deleted">
>      ...
>     </p>

So basically the same thing, ok. So we agree on the syntax.


> > What would this look like in your ideal world? Could you give some 
> > examples of what the above would be like, with code samples?
> 
> The "generic" extractor example I have in python. There's also a 
> Javascript equivalent to that code.
> 
> http://svn.rdflib.net/trunk/rdflib/syntax/parsers/RDFaParser.py
> 
> I'm very familiar with the code required to parse is and it's not hard 
> at all, the problem is that code is specific to that structure. 
> Everytime we have a new structure, we have to write that code. Also, 
> that code is very dependent on the tree structure.

Ok... could you give an example of what the code to process data like the 
above would look like? Not the generic parser part, I mean the code that 
makes a list of the orders as {customer id, part id} tuple, with deleted 
orders omitted, or whatever it is you would do with this data.


>    <p id="order1" class="ibm-order">
>      <span property="ibm-customer">
>       <span property="ex-name">Ian Hickson</span>
>       (<span property="acme-id">95237032895</span>)
>      </span>
>     </p>
>     ....
>    <p>
>      has purchased a
>      <span about="order1" property="ibm-part">
>       <span property="ex-name">Widget x12</span>
>       (part ID <span class="acme-id">295250X12</span>)
>      </span>
>     </p>

The key point here being the reference to an earlier blob in the same 
page, right?

Interesting. That's something that currently can only really be done with 
tables, <output>, and hyperlinks; I wonder if we should add a fourth way 
that is more convenient for Microformat-like data.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list