You don't need to give the namespace variable the same as the prefix that
ActionScript gives it when you toString() it. Internally, it doesn't use a
name and just generates one when you convert the XML to a string.

You can give it something more descriptive like:

namespace w3xml = "http://www.w3.org/XML/1998/namespace";;
trace(""+xml.status.presence.(@w3xml::lang=='en')); // Away


Peter



On 9/26/07, shaun <[EMAIL PROTECTED]> wrote:
>
>   Howdy,
>
> Seth Caldwell wrote:
> > Oh my god Toby, I just spent an hour because I was determined to learn
> about namespaces, and found a solution for you. =)
>
> [snip]
>
> > if(event.result.RDF.*::Status.*::presence.(@*::lang=="en")=="Offline")
> status = "Online";
> >
>
> Nice one Seth.
>
> Here is another solution that uses the namespaces. Note: the xml:lang is
> changed to the aaa namespace(so i used that in the e4x) but I'm not sure
> why that happens(i noticed it when i traced the xml).
>
> //Create the default namespace.
> var ns:Namespace = new
> Namespace("http://www.skype.com/go/skypeweb";);
>
> //Create the aaa namespace that is used instead of "xml":lang.
> var aaa:Namespace = new Namespace("http://www.w3.org/XML/1998/namespace";);
>
> function creationComplete():void{
> var xml:XML = //assume it exists..
> doIt(xml);
> }
>
> private function doIt(xml:XML):void{
> //Set the namespace!
> default xml namespace = ns;
> trace(""+xml.status.presence.(@aaa::lang=='en')); // Away
> }
>
> cheers,
> - shaun
>
>  
>

Reply via email to