Symbol causing error in XML data
Hello Everyone,
As we know that some characters have special meaning in XML data like ampersand (&) is one of them.
So, these characters should be substituted (ie use string replacement) with their respective entity references.
As per XML specification, there are 5 predefined entities in XML:
< < less than
> > greater than
& & ampersand
' ' apostrophe
" " quotation mark
Now alternatively, we can place "text" strings which might contain special characters within a CDATA section so XML parsers will not attempt to parse them.
Here is the solution :
<SomeElement><![CDATA[This & will be ignored]]></SomeElement>
Hope it will helps,
Enjoy
Comments
Post a Comment