December 6th, 2010, 06:26 AM
XML 'CDATA' Error
I m new to XML,
I tried making XML and got error in initial stage because of non-ascii char.
I searched on web and find CDATA to hide the data from parsing.
but this also dont help for me and I am not able to make the XML works.
below is my XML which creates the problem.
<field name="title"><![CDATA[Flirting with Apple ]]></field>
<field name="description"><![CDATA[As the title suggest, I'm kicking around the idea of purchasing an Apple computer. � Models in the the 13" MacBook Air, and the Mac Mini. . � There are some issues I do have. The whole internal battery high tech, but still.... � Anyways, I'd appreciate any feedback/comments on which way I should go. Thanks! � � � � � � ]]></field>
Thanks is advance
December 6th, 2010, 03:25 PM
That's not quite what it does. There's two phases to "parsing" XML, if you will: 1) reading the characters, and 2) parsing it. A CDATA will only prevent #2 from happening (and even then, not all parsing); you still have to pass #1.
Originally Posted by shariqnitt
Set an encoding for your XML.
The encoding can be whatever you want - popular choices are UTF-8 ("utf-8") and ISO 8859-1 ("iso-8859-1").
<?xml version="1.0" encoding="???"?>
Once you've picked one, make sure everything in your XML is in that encoding.
December 7th, 2010, 05:14 AM
at first look at your editor which generated the xml file
which encoding the editor used.
search your sign
example Euro sign €
then use in xml file
after &# used a small x to say is a hex number
<field name="euro">The Euro Sign €</field>
so euro sign is display
<?xml version='1.0' encoding='unicode' ?>
<item>The Euro Sign €</item>
Helmut Hagemann Germany
fallen to the bottom of the facts?
I reach my hand and we go together
wer lesen und google kann ist klar im Vorteil
who read and google is able is clear in the advantage