What is "CDATA" used for in the .agf game file?

Started by Monsieur OUXX, Wed 24/04/2013 12:47:05

Previous topic - Next topic

Monsieur OUXX

Quick quesiton. Here is an excerpt of a regular .agf file :

Code: AGS

      <Dialog>
        <ID>0</ID>
        <Name>dMulbray1</Name>
        <ShowTextParser>False</ShowTextParser>
        <Script><![CDATA[// Dialog script file
@S  // Dialog startup entry point
return
...
@8
mulbray: Goodbye.
stop
]]></Script>


What does that stand for:
Code: AGS
<![CDATA[ ... ]]

I'm confused by the single opening bracket and the double closing bracket as well. And the exclamation mark.
 

JJS

It tells the xml parser to ignore everything inside the CDATA field, so that it doesn't get interpreted as xml: http://www.w3schools.com/xml/xml_cdata.asp . Exlamation mark and double brackets are just how it is written.
Ask me about AGS on PSP, Android and iOS! Source, Daily builds

Crimson Wizard

#2
http://en.wikipedia.org/wiki/CDATA
http://msdn.microsoft.com/en-gb/library/system.xml.xmltextwriter.writecdata.aspx

EDIT: Duh! beaten by JJS.

Quote from: JJS on Wed 24/04/2013 12:51:32
It tells the xml parser to ignore everything inside the CDATA field, so that it doesn't get interpreted as xml
Simply put, this allows to write any special chars there without breaking xml structure.

Monsieur OUXX

I had no idea CDATA was something universal, I thought it was specific to AGS; that's why I overlooked the Wikipedia article and everything else.
Thanks for the clarification, guys.
 

SMF spam blocked by CleanTalk