niallkennedy / open-graph-protocol-tools

Open Graph Protocol validator
http://ogp.me/
255 stars 73 forks source link

http://opengraphprotocol.us/ does not generate xmlns:og="http://ogp.me/ns#" attribute. #1

Closed tobyink closed 12 years ago

tobyink commented 13 years ago

http://opengraphprotocol.us/ does not generate xmlns:og="http://ogp.me/ns#" attribute.

niallkennedy commented 13 years ago

I thought about how to best instruct the user on adding the namespace, preferably to the root element, html, which is not referenced in the markup snippet.

The generator could include a namespace on every generated meta element to ensure inclusion. I could group all of the meta elements as children of another element with the namespace declaration but I am unaware of a valid element (and parsing) of elements that are both a child of head and can be a parent of meta.

If a namespace declaration is used for "og" mappings, might it also make sense to include a base xmlns declaration on these elements where property is a valid attribute of meta? Some publishers may worry about validation errors thrown by HTML validators such as http://validator.w3.org/ .

tobyink commented 13 years ago

I believe is a valid way of grouping elements in HTML 4.x and XHTML 1.x, but not HTML5. :-(

niallkennedy commented 12 years ago

OGP is now RDFa