How to handle special characters in XML attributes?

Discussion in 'XML & RSS' started by 123GoToAndPlay, Oct 2, 2009.

  1. #1
    I have an XML attribute that loads text into Flash and is done so by pulling in an XML attribute value. The problem is that this is a German based xml, and the special characters (ö,ü) in the string are choking the Flash/XML processor.

    for example this would be an xml-node attribute
    
    <menu pageID = "produkte-zubehör" gotoURL="/Produkte/Zubehör">
    
    Code (markup):

    btw:I don't know for sure if this is a xml or flash error
     
    123GoToAndPlay, Oct 2, 2009 IP
  2. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Actually there shouldn't be any special characters in XML as they're supposed to be encoded once they reach the output.

    http://xml.silmaril.ie/authors/specials/

    At least that's how I understand it.
     
    theapparatus, Oct 2, 2009 IP
  3. 123GoToAndPlay

    123GoToAndPlay Peon

    Messages:
    669
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    tx, for your reply. I already tried encoding ö with &ouml; and &#246;

    I do think is has something to do with flash.

    i bypass it by using in AS
    
    addr = addr.split("Zubehr").join("Zubehör");
    
    Code (markup):
    not as clean as i wanted it to be but ..........
     
    123GoToAndPlay, Oct 2, 2009 IP
  4. higreg7

    higreg7 Peon

    Messages:
    469
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Not sure exactly what your problem is, but for flash to support special characters from xml, the xml must be saved as UTF-8 encoding, and if you want to display those characters in a textfield in flash, you need to embed those characters in the textfield first.

    Hope this helps.
     
    higreg7, Oct 3, 2009 IP