html code in xml to be used in flash app

When you use xml to provide data for flash, sometimes you want to have some html formatted text.

Unfortunately, xml doesn’t like this. If you use any html tag, the parser will see it as a new child node.

For example, you just want to use
tag to break a sentence into 2 lines. Flash XML parser will NOT see that
tag the way you (or html parser) see it, although if you bring it to flash, flash html text parser can understand it.

The solution is to use [CDATA[ ]] inside your xml with your html code inside the [ ] brackets. This way, everything inside the brackets will be ignored by xml parser.

Here’s a thread at flashkit that deals with similar issue: hyperlinks in XML


Got something to say?