PDA

View Full Version : How can I get XML to display an apostrophe ?


sineadhartley
06-23-2005, 06:17 PM
Hi there
I have a flash file that reads in data from an xml file. The problem is there is a number of apostophes throughout the text (e.g don't, Sarah's)and they all display as ' in the swf file. I have tried to change the xml fiel by using
<apos> in the place of the apostrophe but to no avail!! E.g. don<apos>t. I have also tried just using ' e.g. Sarah's but again this doesn't work.
Can anyone help???

p.s. I have set my dynamic text fields to render text as html

splict
06-23-2005, 06:53 PM
how are you accessing the value of the text? for something like this
<root>
<node>
don't
</node>
</root>
you should access it like this:
trace(this.firstChild.firstChild.firstChild.nodeVa lue);
// not like this:
trace(this.firstChild.firstChild.firstChild);
notice the nodeValue property. that will properly convert the entities.

sineadhartley
06-24-2005, 04:13 PM
Hey Splict
thanks a million! Thats working now......I was accessing the data without using the "nodeValue" property! Excellent! :D

thanks!

splict
06-24-2005, 04:14 PM
no problem! :D