When there is a text which contains the & and ; together with out any space this & is not parsed as & instead it throws error.
It sounds like content expects XML, but what you are passing isn't valid XML. A simple way to convert plain text to XML is
for ($text) { s/&/&/g; s/'/'/g; s/"/"/g; s/</</g; s/>/>/g; }
However, I'd recommend avoiding content completely. The whole point of the module is to provide much better means of accessing and changing data than low-level functions like content.
Also there are some binary data in my text.
That may be a problem.
XML/1.0 doesn't allow many characters.
XML/1.1 doesn't allow the NUL character (chr(0)).
You might have to alter your scheme to allow the binary bits to be base64-encoded.
use XML::SMART;
That should be use XML::Smart;. Case *is* important, even if what you have *appears* to work.
In reply to Re: CDATA probelm in XML::SMart
by ikegami
in thread CDATA probelm in XML::SMart
by KarthikK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |