tags:

views:

60

answers:

2

When I read the documentation on Common-Tags, I thought it would be easy to put this in a jsp because the examples were cut and paste

<body xmlns:ctag="http://commontag.org/ns#" rel="ctag:tagged">
   <span typeof="ctag:Tag" 
         rel="ctag:means" 
         resource="http://rdf.freebase.com/ns/en.u2" 
         property="ctag:label" content="U2"/>
    </span>
</body>

It's a good thing that we're using Eclipse in our dev work. It's telling us that something is wrong with our markup. It's underlining the common-tags markup with yellow returning:

Undefined attribute name

What am I missing here? or is this completely okay?

+1  A: 

The typeof, resource and property attributes are extensions to XHTML which are part of the RDFa specification which is why Eclipse doesn't know about them.

Since RDFa+XHTML is now a W3C recommendation this is absolutely fine to use as is.

http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes

RobV
Also, the W3C validator can validate XHTML+RDFa: http://validator.w3.org/
Jukka Matilainen
A: 

I assume you're not sending your pages with an XML MIME type, because that snippet isn't well-formed. Using RDFa isn't allowed when using a text/html MIME type. For an alternative, have a look at "microdata".

Ms2ger
There is a proposal now to put rdfa into html http://www.w3.org/TR/rdfa-in-html/
karlcow
Yes, a *proposal*. I personally don't like it at all.
Ms2ger