[thelist] Adding attributes for tags

James Hardy evolt at weeb.biz
Tue Jul 12 04:16:09 CDT 2005


Christian Heilmann wrote:

>>>That has nothing to do with  _validating custom attributes_ though.
>>>The above error shows the attributues are already in the markup. An
>>>own DTD helps validating them:
>>>
>>>http://www.alistapart.com/articles/customdtd/
>>>http://www.alistapart.com/articles/scripttriggers/
>>>
>>>If it is worth the hassle is up to you tough :-)
>>>
>>>      
>>>
>>But if you left them out of the XHTML and then added the attributes to
>>the elements using JS and DOM via the body.onload, it would validate but
>>the elements would have those attributes when they needed to be refered to.
>>    
>>
>
>Invalid code is invalid code. Does not really matter how you generate it. 
>
>
>  
>
Not really, however this script obviously uses a hack which causes 
invalid code, it's never going to validate as XHTML, the best he can 
hope for is XHTML+XML. If one of his requirements is valid XHTML served, 
this second hack will allow it to happen, though of course it will 
swiftly be invalidated.

Personally, I'd recode the script to identify the elements with id 
fields but that's just me ;)


More information about the thelist mailing list