Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

usage of xmlns:prefix attribute 'not allowed' in html5 tags #70

Open
oafx opened this issue Dec 11, 2014 · 2 comments
Open

usage of xmlns:prefix attribute 'not allowed' in html5 tags #70

oafx opened this issue Dec 11, 2014 · 2 comments

Comments

@oafx
Copy link

oafx commented Dec 11, 2014

Hi,

it appears to me that mapping a type and using the xmlns:<prefix>="<url>" definition creates the corresponding xmlns: html attribute for the element you chose to be your wrapper, which, as far as i understand and the w3c validator tells me, isn't allowed in html5, or at least deprecated, resulting in a 'Attribute xmlns: not allowed here' validation error at w3c, even though it is still processed.

See: http://www.w3.org/TR/rdfa-in-html/#backwards-compatibility

Rather than using xmlns:<prefix>="<url>" in html5 it seems to be advised to use prefix="<prefix>: <url>". or the vocab=<url> attribute for definition of the namespace without a prefix. The definition of both attributes in the mapping/type though will be ignored by the RdfDriverXml::loadType() function (and is probably semantically incorrect?)

An easy fix would probably be to translate the namespace definition in the mapping to the corresponding prefix attribute but i'm not really sure if this is good as it's only the html5+rdfa 1.1 spec that would be served by that?

This issue is a followup from https://groups.google.com/forum/#!topic/symfony-cmf-users/5TCfp2Xzups

Thanks for the read

@flack
Copy link
Collaborator

flack commented Dec 11, 2014

Hi!

yes, I've noticed the validation errors, too. I mentioned this to @bergie and IIRC correctly he said that it can't be helped (but this was a while ago, maybe things have cahnged since then). The question is, will the prefix="<prefix>: <url>" be picked up correctly by Create.js? If so, the cleanest solution would probably be to have separate renderers for different doctypes, f.x. an XhtmlRenderer that produces the markup we have now, and a Html5rdfa11Renderer (is that the correct classname according to PSR?) that produces the markup you suggest.

But like I said, first of all someone would have to verify if the html5+rdfa 1.1 markup works with Create.js at all.

@oafx
Copy link
Author

oafx commented Dec 11, 2014

the changes in my fork of your repo are very very q&d-ish oafx/createphp@flack:master...master but updating/saving the content of the document still seems to work (besides the tests failing because the xmlns: is still expected) now, that i've registred the prefix and url in use via setVocabulary().

+1 for the seperate renderers solution btw.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants