OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] CDATA strangeness

[ Lists Home | Date Index | Thread Index ]

In article <NDBBLNCOMCPLKABNJBLKOEBAGDAA.ramin@wizen.com> you write:

><!--[if IE]><script language=javascript>ie5=1;</script><![endif]-->

That bit's OK, it's just a comment.

><![if !IE]><script language=javascript>ie5=0;</script><![endif]>

But that isn't.

>I thought a CDATA section *had* to start with '<![CDATA[' 

That's right.

>and plain '<![' should be ignored.

But that isn't.

<![ followed by anything except CDATA is illegal in an XML instance
(in the DTD it could be a conditional section).  It's just a syntax
error.  Less-than must be escaped when it isn't markup - XML doesn't
just ignore it.

>If you pass this through the tidy/xerces-C combo, the parser complains that
>it expects to see a CDATA section start around the '<![if' section. 

It may not be the best error message in the world - it's presumably
just assuming that you must have meant CDATA because that's the only
thing that's legal after <![.

>Who's right and who's wrong here? The web-site or tidy/xerces?

Well if it's *meant* to be XML, then the web-site is just wrong.
But is it meant to be XML?  I'm not sure what its status is as HTML
(ie SGML).  

-- Richard




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS