views:

41

answers:

2

Hi Guys

I've been creating a lot of my own custom attributes in my XHTML documents lately, and am aware that because they are custom attributes, they won't validate against the W3C standard.

Isn't it true that I can specify my own DTD to make it validate? If so, can anyone tell me what's involved in doing this in an ASP.NET MVC app?

Thanks

Dave

+1  A: 

Isn't it true that I can specify my own DTD to make it validate?

Valid. Non-standard. No guarantee that it will work.

If so, can anyone tell me what's involved in doing this in an ASP.NET MVC app?

http://www.vivtek.com/xml/writing_dtd.html should get you started. There server side language doesn't matter, it is just a markup thing.

David Dorward
@David, I'm not entirely sure what you mean by "Valid. Non-standard. No guarantee that it will work." - do you mean that I *can* specify my own DTD, but that doing so is non-standard and as such there is no guarantee that it'll work? Thanks
DaveDev
Yes. If you write a DTD to validate against a custom markup language then you aren't using a standard markup language. If you claim that markup language is text/html then expect browsers to treat it as HTML, and possibly not handle your custom attributes as you want.
David Dorward
A: 

You can use your own namespace, that way you can use your custom attributes and still have a valid document. Facebook uses it too for their login control on 3th party websites.

ZippyV