Re: [whatwg] Features for responsive Web design
On Fri, May 18, 2012 at 1:54 PM, Benjamin Hawkes-Lewis bhawkesle...@googlemail.com wrote: On Fri, May 18, 2012 at 2:53 PM, Boris Zbarsky bzbar...@mit.edu wrote: On 5/18/12 3:16 AM, Markus Ernst wrote: 1. Are there other cases in HTML where an attribute value contains more than one URI? * The archive attribute of applet (comma-separated list of URIs) * The ping attribute of a (space-separated list of URIs) * The style attribute (which can, e.g., set both border-image and background-image). There might be others, but this is off the top of my head. HTML4's @profile is a whitespace-separated URI list: http://www.w3.org/TR/html4/struct/global.html#adef-profile RDFa's @property and @typeof are whitespace-separated lists of CURIEs: not only CURIEs, they can also be full URIs. Steph. http://www.w3.org/TR/rdfa-in-html/#extensions-to-the-html5-syntax http://www.w3.org/TR/rdfa-core/#s_syntax -- Benjamin Hawkes-Lewis
Re: [whatwg] adding microdata to basic links
Hi Ian, On Thu, Dec 8, 2011 at 5:11 PM, Ian Hickson i...@hixie.ch wrote: On Wed, 24 Aug 2011, Stéphane Corlosquet wrote: Starting from a basic markup like this: [[[ This book has been authored by a href=http://smith.org/john;John Smith/a. ]]] I would like to markup both the textContent of the link (John Smith) and the url from the href attribute. In RDFa this is done by adding a couple of attributes to the a element. It would read like this: [[[ This book has been authored by a property=name rel=url href= http://smith.org/john;John Smith/a. ]]] Is there any way to do the same in microdata without adding a new HTML element to the markup? On Wed, 24 Aug 2011, Tab Atkins Jr. wrote: No, Microdata purposely keeps its data model simple by expressing property names through a single attribute. Since having @itemprop on an a always refers to the @href of the element, you must nest an additional element, such as a span, into your markup to carry the property that refers to the text content. Indeed. The reasoning is that it's hard to understand otherwise; e.g. it's not at all immediately obvious to me that this is wrong, though it is: a property=url href=http://smith.org/john;John Smith/a I agree, and I have seen people doing that mistake (including myself!). The RDFa WG received a lot of similar feedback, so it was decided to do something about it. While the snippet above is wrong in RDFa 1.0, it is correct in RDFa 1.1 (@property will pick up @href if there is no @rel). So you can write RDFa without using @rel in the same fashion as microdata. That's a good example of microdata design feeding into other standards. Steph. ...and while an experienced author would know that rel is to href as property is to the contents, an inexperienced one might still make mistakes such as: a property=url href=http://smith.org/john; rel=nameJohn Smith/a In microdata, a always gives the URL, which simplifies it a bit, at the cost of making this example more verbose. On Wed, 24 Aug 2011, Tantek Ã~Gelik wrote: This does seem to be a (fairly common) case where microdata requires additional markup (another element) whereas both microformats (e.g. hCard) and [RDFa] (through the perhaps questionable overloading of 'rel') do not. Yeah. Microformats 2 has an interesting compromise solution where Hungarian notation is used to denote the type of the property, and that type is used to determine how it is read. The cost of that of course is the slightly more verbose markup in all property names. On Wed, 24 Aug 2011, Stéphane Corlosquet wrote [edited for simplicity]: [[[ This book has been authored by span vocab=http://schema.org/; typeof=Person a property=name rel=url href=http://smith.org/john;John Smith/a /span ]]] On Wed, 24 Aug 2011, Edward O'Connor wrote [edited for brevity]: This could be represented in Microdata without an extra element: Well, microdata needs to use an element that is undecorated in the original, namely the p that I removed in the quote above: p itemscope itemtype=http://schema.org/Person; This book has been authored by span itemprop=name a itemprop=url href=http://smith.org/john;John Smith/a /span /p The microformats for this particular case is shorter still. I haven't changed microdata for this; the current design is an intentional trade-off between verbosity and predictability. -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] adding microdata to basic links
On Wed, Aug 24, 2011 at 1:18 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: On Wed, Aug 24, 2011 at 10:02 AM, Stéphane Corlosquet scorlosq...@gmail.com wrote: Starting from a basic markup like this: [[[ This book has been authored by a href=http://smith.org/john;John Smith/a. ]]] I would like to markup both the textContent of the link (John Smith) and the url from the href attribute. In RDFa this is done by adding a couple of attributes to the a element. It would read like this: [[[ This book has been authored by a property=name rel=url href= http://smith.org/john;John Smith/a. ]]] Is there any way to do the same in microdata without adding a new HTML element to the markup? No, Microdata purposely keeps its data model simple by expressing property names through a single attribute. Since having @itemprop on an a always refers to the @href of the element, you must nest an additional element, such as a span, into your markup to carry the property that refers to the text content. Thanks for clarifying this, Tab. Steph. ~TJ
Re: [whatwg] adding microdata to basic links
Hi Tantek, On Wed, Aug 24, 2011 at 1:30 PM, Tantek Çelik tan...@cs.stanford.eduwrote: On Wed, Aug 24, 2011 at 10:22, Stéphane Corlosquet scorlosq...@gmail.com wrote: On Wed, Aug 24, 2011 at 1:18 PM, Tab Atkins Jr. jackalm...@gmail.com wrote: On Wed, Aug 24, 2011 at 10:02 AM, Stéphane Corlosquet scorlosq...@gmail.com wrote: Starting from a basic markup like this: [[[ This book has been authored by a href=http://smith.org/john;John Smith/a. ]]] I would like to markup both the textContent of the link (John Smith) and the url from the href attribute. In RDFa this is done by adding a couple of attributes to the a element. It would read like this: [[[ This book has been authored by a property=name rel=url href= http://smith.org/john;John Smith/a. ]]] Stéphane, this looks like an incomplete example - how does a parser know where the object that has name and url property starts and ends, is it the whole page? The nearest common ancestor element? AKA how does a parser determine the scope of the object? And are name and url intended to be page-specific properties, or do they belong to a theoretical shared vocabulary? Could you provide a complete RDFa example of what you're attempting to accomplish? I purposely left out the context markup here as I was more interested in the a element. But here is the RDFa markup. I'm not overloading it with other attribute such as the title of the book for keeping the example small. [[[ p This book has been authored by span vocab=http://schema.org/; typeof=Person a property=name rel=url href=http://smith.org/john;John Smith/a /span /p ]]] Is there any way to do the same in microdata without adding a new HTML element to the markup? No, Microdata purposely keeps its data model simple by expressing property names through a single attribute. One person (parser developer's) simple, is another person's (web author/designer/publisher) odd new strange way, and thus far from simple. It's a trade-off rather than being simple in any absolute terms. Since having @itemprop on an a always refers to the @href of the element, you must nest an additional element, such as a span, into your markup to carry the property that refers to the text content. This does seem to be a (fairly common) case where microdata requires additional markup (another element) whereas both microformats (e.g. hCard) and microdata (through the perhaps questionable overloading of 'rel') do not. I think you meant RDFa here. Steph. Stéphane, if you could provide a complete RDFa example of the content example you gave, I'd like to see what Tab (or anyone else) sees as an ideal way to mark it up with microdata instead for comparison purposes. Thanks, Tantek -- http://tantek.com/ - I made an HTML5 tutorial! http://tantek.com/html5
Re: [whatwg] adding microdata to basic links
Hi Ted, On Wed, Aug 24, 2011 at 3:53 PM, Edward O'Connor eocon...@apple.com wrote: Tantek asked: Could you provide a complete RDFa example of what you're attempting to accomplish? Stéphane replied: p This book has been authored by span vocab=http://schema.org/; typeof=Person a property=name rel=url href=http://smith.org/john;John Smith/a /span /p This could be represented in Microdata without an extra element: p itemscope This book has been authored by span itemprop=name a itemprop=url href=http://smith.org/john;John Smith/a /span /p Not the same. The span element in my example was used to assert a type, which you repurposed for the name property. So no matter what, you need to wrap the a element or its textContent with an extra span element for the name property, e.g. p itemscope This book has been authored by span itemscope itemtype=http://schema.org/Person; span itemprop=name a itemprop=url href=http://smith.org/john;John Smith/a /span /span /p Steph. Or in the hCard microformat with even less markup: p class=vcard This book has been authored by a class=fn url href=http://smith.org/john;John Smith/a /p HTH, Ted