View Full Version : Escaping special characters in XML

01-05-2004, 06:29 AM
I want to have special characters in elements so rather than using htmlentities(), I'm using <![CDATA[ ]]>. An example would be the following:

<REPORT_DATE><![CDATA[ 11-Nov-2003 ]car & ><<><>< < ]]></REPORT_DATE>
<OWNER>Broomfield CO 80021 United States</OWNER>

<OWNER>VA 20166 United States</OWNER>

Now, characters such as & > < ' " work fine. The problem is when I use the ] [ characters inside <![CDATA[ ]]>. Is it because I have to escape these bracket characters? In this case "11-Nov-2003 ]" doesn't get displayed, just what follows. It's because of the "]".

Any thoughts? Thanks.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum