Ben,
 
I'm not an expert on the XML type, nor label functions or UI components,  but some things to consider in your investigation:
 
1. You can get a list of all of the namespaces from an XML instance using:
 
    var namespaces:Array = myXML.namespaceDeclarations();
    var ns:Namespace;
    for each (ns in namespaces)
    {
         // Can check through each ns.prefix to find the default NS and get its ns.uri property
        if (ns.prefix == "")
            defaultNSURI = ns.uri;
    }
 
2. In the methods on the XML type that take an element name to operate on, you don't have to pass in a string, you can pass in a QName. So, construct a QName from the URI found in the default namespace avoid and pass this to the method on XML to perform your search.
 
        var qname:QName = new QName(defaultNSURI, "message");
        var messages:XMLList = myXML.child(qname);

 
(Note that using a QName to lookup a property is also valid for objects using the square-bracket syntax ... myobj[qname] works just like myobj[dynamicPropNameString]... in fact, the public namespace is just a special case, most things should theoretically be looked up by QName if using other namespaces).
 
 
 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard
Sent: Wednesday, June 07, 2006 5:07 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Namespace hell

From what I can gather, default namespaces in XML data simply aren't
very well supported in AS3/Flex 2. Can someone from Adobe chime in to
confirm or deny this? Should we simply try to avoid them at all costs?

Thanks,
Ben

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to