8 Replies Latest reply: Dec 10, 2010 2:58 AM by Wrataxas RSS

    get XML declaration

    tedalde2 Community Member

      this should be easy, but I can't figure it. How do I get an XML declaration in AS3? I need to get any encoding= parameter. For example this XML:

      <?xml version="1.0" encoding="UTF-8"?>





      It's XML text that loads externally from a URL using URLLoader. I create the XML object by doing var xml:XML = new XML(evt.target.data) upon load complete. I've tried XML.ignoreProcessingInstructions = false and no effect. xml.children()[0] is the first node, not the declaration. Do I need to manually parse the raw string data that is returned from URLLoader? That seems silly.