473,382 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Displaying quotation marks from xml

Hello,
My xml file (encoding=UTF8) is generated from a mysql database via a php script. The dynamic text field in flash displays '"' . I've made sure the the font is embedded. Any suggestions?

Thanks, JD
Jul 11 '07 #1
2 7716
Motoma
3,237 Expert 2GB
Hello,
My xml file (encoding=UTF8) is generated from a mysql database via a php script. The dynamic text field in flash displays '"' . I've made sure the the font is embedded. Any suggestions?

Thanks, JD
Take a look at your XML file. Does " appear in it?
Jul 12 '07 #2
xNephilimx
213 Expert 100+
Hello,
My xml file (encoding=UTF8) is generated from a mysql database via a php script. The dynamic text field in flash displays '"' . I've made sure the the font is embedded. Any suggestions?

Thanks, JD
I had the very same problem, plus some others with special characters in flash, like html stuff. I solved it making a function to rebuild the HTML and other special chars like the ampersand (this is waht you'll need the most)

First make sure if you have the quotation marks this way ", if they are, make sure the content is between a CDATA block and change the " entities for the actual quotation marks, like this

Expand|Select|Wrap|Line Numbers
  1. <sometag><![CDATA[The content goes here, put the quotation marks like "this".]]></sometag>
  2.  
In some part of your code in the flash file add this function:

Expand|Select|Wrap|Line Numbers
  1. function rebuildHTML(theText:String):String {
  2.     var tempText:String = theText;
  3.     var chunks:Array = new Array();
  4.  
  5.     chunks = tempText.split("&lt;");
  6.     tempText = chunks.join("<");
  7.     chunks = tempText.split("&gt;");
  8.     tempText = chunks.join(">");
  9.     chunks = tempText.split("&amp;");
  10.     tempText = chunks.join("&");
  11.  
  12.     chunks = tempText.split("href=&quot;");
  13.     tempText = chunks.join("href=\"");
  14.     chunks = tempText.split("&quot;>");
  15.     tempText = chunks.join("\">");
  16.     return tempText;
  17. }
  18.  
This function rebuilds the basic HTML tags, all the "<" and ">", the link tags and the ampersand.
Look here:

chunks = tempText.split("&amp;");
tempText = chunks.join("&");

Here is where I change the &amp; character to the actual "&". Flash does the following. When flash encounters a lliteral quotation mark it changes to the entity &quot;, the same with the ampersand if it finds a &quot; it replace the & in the quot entity for an &amp; so it reads &quot; and that's just worg. So with this function we solve that problem.

Now, how should you use it?
Instead of asinging the value of the xml node directly into the variable or text object instace like you would normally do, you should asing it the function passing as the parameter the xml node avalue, cause the function returns the text parsed:

Expand|Select|Wrap|Line Numbers
  1. //instead of doing this:
  2. b.htmlText = nodes[i].firstChild.firstChild.nodeValue;
  3.  
  4. //you do this:
  5. b.htmlText = rebuildHTML(nodes[i].firstChild.firstChild.nodeValue.toString());
  6.  
Try it and let me know wether it works.

Regards!
Jul 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: NikkoW | last post by:
I need to assign a string to a variable but the text string includes quotation marks: Example: MyString = "He turned and said "Hello" before leaving." When the compiler hits the quotation...
8
by: Stephen Poley | last post by:
One disadvantage of using a simple text editor to produce HTML is that it is relatively time-consuming to put in the proper typographical quotation marks and dashes. A round tuit having arrived...
63
by: Tristan Miller | last post by:
Greetings. Do any popular browsers correctly support <q>, at least for Western languages? I've noticed that Mozilla uses the standard English double-quote character, ", regardless of the lang...
4
by: Thomas Miskiewicz | last post by:
Hi! Is using of a double quotation mark with a URL a problem? For example: http://myserver.com/query?field1=something&field2=test&params="field1=test1"+"field2=test2" Regards Thomas
7
by: Paradigm | last post by:
I am trying to create a recordset where some text fields are matching. The problem is that some of the text fields contain quotation marks. I have tried to create the sql string using replace eg....
0
by: Aaron Deskins | last post by:
Hello all, I'm trying to set up a database to track articles and documents. I've created a Table to hold the information I need. I've set up one of the fields to hold the actual text of the...
1
by: Richard | last post by:
I've read the posts here and VeriSign's KB articles, which pertain to the seal not displaying in development mode. However, the seal still won't show up on the .aspx production page, but it does...
1
by: Richard | last post by:
I've read the posts here and VeriSign's KB articles, which pertain to the seal not displaying in development mode. However, the seal still won't show up on the .aspx production page, but it does...
3
by: Ufit | last post by:
Simple,dumm question - how to include quotation marks in the string? F.ex. "Data Source=.\SQLEXPRESS;AttachDbFilename="C:\client data.mdf";Integrated Security=True;User Instance=True" I get syntax...
31
by: The Bicycling Guitarist | last post by:
Hi. For many years I have been using &quot; for double quotation marks in the HTML code, but the opening and closing quotation marks render the same in my browser. I'm considering going through and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.