开发者

How to register XHTML namespaces?

开发者 https://www.devze.com 2023-01-03 23:20 出处:网络
My page use to validate for XHTML but I added the addthis buttons to page and it gives a new namespace:

My page use to validate for XHTML but I added the addthis buttons to page and it gives a new namespace:

E.G.:

  <a addthis:url="http://domain.tld/path/to/stuff" addthis:title="Teh Title here">

I tried:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:addthis="http://addthis.com/" lang="en"> 

Doesn't work.

Can we register namespaces for the validator???

I AM EMOT开发者_如何学运维IONALLY ATTACHED TO VALID XHTML. I like addthis, I think its the best button of its kind (yes, I need to use the namespace properties, I know you dont have to but I do for what im doing PHP project) :(


If you add another namespace then you are not writing XHTML, you are writing XHTML + Something.

This means you need a DTD or schema that describes XHTML + Something to validate against. If you are using a schema, then you need to use a schema validator (the W3C Markup Validation Service only does DTDs and (experimentally) HTML 5).

Note that the URI used in a namespace attribute is not a URL, it is just a sting that uniquely identifies the namespace. Making it look like a URL helps avoid collisions but parsers are not supposed to do anything with any data that might be at the other end of it.

(Also, you will have stepped outside the "profile of XHTML" mentioned in the text/html RFC so you shouldn't be using that content type (so it won't work in IE)).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号