View Full Version : XHTML complient coding
pkcidstudio
01-29-2007, 06:18 PM
I am looking to make this bit of code XHTML compiant. The problem is that it is seeing the --> as the closing comment to the intial <!-- any thoughts on how this can be solved?
<!--[if lt IE 7]> <!-- adsfasdf --> <![endif]-->
I was thinking this might work...
<![CDATA[
<!--[if lt IE 7]> <!-- adsfasdf --> <![endif]-->
]]>
but i could not.
Hm, tricky one. You could just use the <comment></comment> tag, which is now unsupported in just about every browser except IE.
However, a more pressing question is: why? IE can't read XHTML anyway, so why are you bothering with the conditional comments?
pkcidstudio
01-30-2007, 01:13 PM
Screen readers have a hard time reading code if it is not compliant. The current project this is for runs everything through XML.spy and if there are any concerns then a red flag is posted. I'll try what you suggested, if any other thoughts feel free to share.
Rather than XHTML and XML.spy, I would suggest HTML (4.01 Strict) and the validator (http://validator.w3.org/). Since you're also serving this to IE, it appears apparent that you're serving it as text/html. Thus, it's not actually being (or shouldn't actually be) parsed as XHTML by any user agent, browser or screenreader; you're effectively serving up invalid HTML, not XHTML at all.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.