Hi I’ve got a problem with some XML data which looks like (this is an extract of the node in question, the rest of the XMl is well formed):
<slide data=“id=006”>
<TEXTFORMAT LEADING=“2”>
<P ALIGN=“LEFT”>
<FONT FACE=“Arial” SIZE=“72” COLOR=“#17FBFB” LETTERSPACING=“0” KERNING=“0”>dsfsdfsdf</FONT>
</P>
</TEXTFORMAT>
<TEXTFORMAT LEADING=“2”>
<P ALIGN=“LEFT”>
<FONT FACE=“Arial” SIZE=“72” COLOR=“#17FBFB” LETTERSPACING=“0” KERNING=“0”>sdfdsfdsf</FONT>
</P>
</TEXTFORMAT>
<TEXTFORMAT LEADING=“2”>
<P ALIGN=“LEFT”>
<FONT FACE=“Arial_11pt_st” SIZE=“11” COLOR=“#000000” LETTERSPACING=“0” KERNING=“0”>
<FONT FACE=“Arial” SIZE=“72” COLOR=“#17FBFB”>sadsad</FONT>
</FONT>
</P>
</TEXTFORMAT>
</slide>
after loading the XML node to an array and displaying it using:
_root.coverMov.contentHTML.styleSheet = format;
_root.coverMov.contentHTML.htmlText = slideArray[_global.theCurrentSlide].htmlText;
then quite a strange problem presents itself! after every
</TEXTFORMAT>
<TEXTFORMAT LEADING=“2”>
in the XML, a mystery comma “,” is added. Each textformat block represents a newline in the final output. no comma is present in the XML and this is inserted by flash.
if I insert a trace into the actionscript at any point after the data is loaded into Flash the comma’s are present. A Copy-Paste of a trace() from the output window:
<TEXTFORMAT LEADING=“2”><P ALIGN=“LEFT”><FONT FACE=“Arial” SIZE=“72” COLOR=“#17FBFB” LETTERSPACING=“0” KERNING=“0”>dsfsdfsdf</FONT></P></TEXTFORMAT>,<TEXTFORMAT LEADING=“2”><P ALIGN=“LEFT”><FONT FACE=“Arial” SIZE=“72” COLOR=“#17FBFB” LETTERSPACING=“0” KERNING=“0”>sdfdsfdsf</FONT></P></TEXTFORMAT>,<TEXTFORMAT LEADING=“2”><P ALIGN=“LEFT”><FONT FACE=“Arial_11pt_st” SIZE=“11” COLOR=“#000000” LETTERSPACING=“0” KERNING=“0”><FONT FACE=“Arial” SIZE=“72” COLOR=“#17FBFB”>sadsad</FONT></FONT></P></TEXTFORMAT>
I scanned the chunks of text and removed all comma’s but then all legitimate ones are removed too, which is far from ideal.
Has anyone got any idea’s for removing this?
many thanks for your time,
Alejandro