quote:
CDATA - (Unparsed) Character Data The term CDATA is used about text data that should not be parsed by the XML parser. Characters like "<" and "&" are illegal in XML elements. "<" will generate an error because the parser interprets it as the start of a new element. "&" will generate an error because the parser interprets it as the start of an character entity. Some text, like JavaScript code, contains a lot of "<" or "&" characters. To avoid errors script code can be defined as CDATA. Everything inside a CDATA section is ignored by the parser. A CDATA section starts with "<![CDATA[" and ends with "]]>":
I spent a whole bloody day trying to solve this one! Thanks for the advice here guys....![]()
Here's the "How to..." instructions I made for myself (I will need this later as a function of age)....
Inserting <br /> line breaks in XML content:
It's necessary to add a line of code directly after the dataset at the top of the (spry) htm page that sets the columnType:
var dsRegInfoElem = new Spry.Data.XMLDataSet("regisinfo.xml", "sites/level1/site",{distinctOnLoad:true});
dsRegInfoElem.setColumnType('datetime','html');<!--This line is necessary for the line breaks in the xml CDATA sections to work-->
Make sure the xml tag that will contain the CDATA wrap is identified (here it's the <datetime> tag).
Then, in the XML file, add the CDATA wrap just inside the tag like this:
<datetime><![CDATA[texttexttexttext]]></datetime>
Now just insert the <br /> where I need it!
<datetime><![CDATA[texttext<br />texttext]]></datetime>
North America
Europe, Middle East and Africa
Asia Pacific