A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: html special character?

  1. #1
    Junior Member
    Join Date
    Aug 2002
    Posts
    3
    hi, i am trying to write a flash program that reads in and updates an xml file. i'm letting the user type in html tags into the xml, but i can't put brackets in the xml, so i need to use the characters !lt; for "<", and !gt; for ">". (replace ! with &)

    The thing is that it takes too much time to convert all the string of html, and it times out.

    does anyone know how to get around this problem?

    thanks sooooo much...
    [Edited by flykittenfly on 09-03-2002 at 06:54 PM]

  2. #2
    FK Catwoman Aria's Avatar
    Join Date
    Aug 2000
    Location
    Travelling
    Posts
    2,313
    do you declare all your special chars (or entities)? by any chance.

    you should be able to have as many named character as you like, as long as you tell the parser what each name means in advance.

    i.e.

    < ?xml version="1.0"?>
    < !DOCTYPE names [
    < !ENTITY ccedilla "& #231;">]>
    < !
    < !ignore the space between the & and the #
    < names>
    < name>Franc&ccedilla;ois</name>
    < /names>



    a

  3. #3
    Flash Guru wanna-be cylon's Avatar
    Join Date
    May 2002
    Location
    Galactica
    Posts
    205
    Originally posted by Aria
    do you declare all your special chars (or entities)? by any chance.

    you should be able to have as many named character as you like, as long as you tell the parser what each name means in advance.

    i.e.

    < ?xml version="1.0"?>
    < !DOCTYPE names [
    < !ENTITY ccedilla "& #231;">]>
    < !
    < !ignore the space between the & and the #
    < names>
    < name>Franc&ccedilla;ois</name>
    < /names>



    a

    Thanks for the advise aria, but... I just cant seem to get my attempt to work and was wondering if you could help.

    Im trying to declare bullet points and greater than characters.

    basically what I have is a flash built application which allows a user to input text which will can be saved a read.
    It all works well exept when a ">" (I gathered that xml sees this as a closing tag) is used or when a bullet point created by "Alt" + "0" "1" "4" "9" is used.

    Any help greatly appreciated.
    Step away from your monitor<br>go surfing!

  4. #4
    Senior Member
    Join Date
    Sep 2002
    Posts
    185

    French TXT

    Hello,

    I'm having the same problem here. I'm making a site with xml containing french Text. There are a lot of special characters ( é,è, ç, Ã*, etc.). I guess the solution is here but I don't understand how to use it. Is there maybe an explenation somewhere around.
    thx
    Stefan
    I think...I dreamed...in pixels last night...

  5. #5
    Senior Member
    Join Date
    Sep 2002
    Posts
    185

    french in xml

    Hi,
    I think i found a solution, type this code in the same frame as where your xml file is loaded. I could use all characters (&é@§èçÃ*)

    system.useCodepage = true

    I'm not sure what to full effect of statement is... maybe someone else knows?
    Stefan
    I think...I dreamed...in pixels last night...

  6. #6
    Junior Member
    Join Date
    May 2004
    Posts
    8
    Well nothing seems to be working for me. I simply want my inch marks (&quot in my XML data to remain inch marks once brought into my Flash file.

    But they get converted TO &quot;

    It doesn't make any difference if the text field is set to HTML or not. If I replace " with &quot; in the actual XML data, I get &quot;quot; displayed in my Flash file.

    I have tried putting the following at the beginning of my XML data, to no avail:

    < ?xml version="1.0"?>
    < !DOCTYPE names [
    < !ENTITY inch "&#34;">
    ]>

    Maybe there is still something I haven't tried, but it's getting pretty frustrating. Any help would be VERY appreciated!

    hmmdinger
    Last edited by hmmdinger; 05-19-2004 at 02:15 PM.

  7. #7
    Senior Member
    Join Date
    Sep 2002
    Posts
    185
    Hi,

    I found an other solution for my problem maybe it helps you

    I have to save the xml file with encoding="utf-8".
    <?xml version="1.0" encoding="utf-8"?>
    I did this in dreamwaever, I think I read somewhere that just typing it isn't good enough. you really have to chance your xml file props (modify, - page properties)

    Then, in flash mx 2004, I fill in the needed chars into the textfield characters options. It works for me
    that's it, don't know anything else
    mvg
    Last edited by P-Sch1FT; 05-19-2004 at 02:10 PM.
    I think...I dreamed...in pixels last night...

  8. #8
    Flash Guru wanna-be cylon's Avatar
    Join Date
    May 2002
    Location
    Galactica
    Posts
    205
    Originally posted by hmmdinger
    Well nothing seems to be working for me. I simply want my inch marks (&quot in my XML data to remain inch marks once brought into my Flash file.

    But they get converted TO &quot;

    It doesn't make any difference if the text field is set to HTML or not. If I replace " with &quot; in the actual XML data, I get &quot;quot; displayed in my Flash file.

    I have tried putting the following at the beginning of my XML data, to no avail:

    < ?xml version="1.0"?>
    < !DOCTYPE names [
    < !ENTITY inch "&#34;">
    ]>

    Maybe there is still something I haven't tried, but it's getting pretty frustrating. Any help would be VERY appreciated!

    hmmdinger

    found a good link for you:
    http://xmlwriter.net/xml_guide/entit...arameterEntity

    states below for values....

    entity value: any character that is not an '&', '%' or ' " ', a parameter entity reference ('%Name;'), an entity reference ('&Name;') or a Unicode character reference.

    hope this helps.

    Im stuck too as Im trying to do the below:

    < ?xml version="1.0"?>
    < !DOCTYPE names [
    < !ENTITY & amp; "&">
    ]>

    without the space before "amp"
    Anyone know about a work around for this???
    Step away from your monitor<br>go surfing!

  9. #9
    Junior Member
    Join Date
    May 2004
    Posts
    8
    *sigh*

    Ok, wow, what am I missing?! I have downloaded EditiX, a dedicated XML editor, allowing me to set encodings and everything, and I get ZERO effect on my problem.

    cylon, what you quoted seems to imply I shouldn't have to do ANYTHING special to have the double quote character display properly.

    P-Sch1FT, I used your line of code, and even found the Macromedia page explaining it and still, nothing.

    The first part of my XML code:
    (Pretend the space between & and "quot;" isn't there)

    < ?xml version="1.0" encoding="UTF-8"?>
    < techr>
    < size name="205/55ZR14 SL">UTQG: 40 B C
    Max Load: 1135 lbs.
    Max Inflation Pressure: 51 psi
    Tread Depth: 4/32nds
    Rim Width Range: 5.5-7.5& quot;
    Measuring Rim Width: 6.5& quot;
    Section Width: 8.5& quot;
    Tread Width: 7.9& quot;
    Overall Diameter: 22.9& quot;
    Revs Per Mile: 881
    < /size>

    What I am seeing in the .swf, regardless of whether or not I use "System.useCodepage":

    UTQG: 40 B C
    Max Load: 1135 lbs.
    Max Inflation Pressure: 51 psi
    Tread Depth: 4/32nds
    Rim Width Range: 5.5-7.5& quot;
    Measuring Rim Width: 6.5& quot;
    Section Width: 8.5& quot;
    Tread Width: 7.9& quot;
    Overall Diameter: 22.9& quot;
    Revs Per Mile: 881

  10. #10
    Junior Member
    Join Date
    May 2004
    Posts
    8
    Just an update, my inch marks are displaying!

    That's the good news. The bad news is that I have no idea why. It just sort of happened. I'm not doing any of the things I've been told to do because none of those things were working.

    Maybe one day I'll figure it out and report back.

    Thanks for the help everybody.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center