hi all - i'm trying to get the english status from a skype status xml (below). What I'm not sure how to deal with is the xml:lang attribute. I'm sure there's a clever way to set the namespace and use e4x to get out the one i want
but i'm not sure how.  I ended up doing this:

for (i=0; i < event.result.RDF.Status.presence.length; i++) {
                                        if 
(event.result.RDF.Status.presence[i]["xml:lang"] == "en") {
                                                if 
(event.result.RDF.Status.presence[i]["value"] != "Offline") {
                                                        status = "Online";
                                                }
                                                break;
                                        }
                                }

can anyone tell me a cleaner way to do it perhaps using e4x please? I suspect my e4x attempts were misguided.

Toby


<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
        xmlns:dcq="http://purl.org/dc/terms/";
        xmlns="http://www.skype.com/go/skypeweb";
>
 <Status rdf:about="urn:skype:skype.com:skypeweb/1.1">
  <statusCode
        rdf:datatype="http://www.skype.com/go/skypeweb";
        >3</statusCode>
  <presence xml:lang="NUM">3</presence>
  <presence xml:lang="en">Away</presence>
  <presence xml:lang="fr">Absent</presence>
  <presence xml:lang="de">Abwesend</presence>

  <presence xml:lang="ja">一時退席中</presence>
  <presence xml:lang="zh-cn">暫時離開</presence>
  <presence xml:lang="zh-tw">离开</presence>
  <presence xml:lang="pt">Ausente</presence>
  <presence xml:lang="pt-br">Ausente</presence>
  <presence xml:lang="it">Torno subito</presence>

  <presence xml:lang="es">Ausente</presence>
  <presence xml:lang="pl">Zaraz wracam</presence>
  <presence xml:lang="se">Tillfälligt borta</presence>
 </Status>
</rdf:RDF>










-----------------------------------

        Life is poetry, write it in your own words

-----------------------------------

Toby Tremayne
IT Director
Code Poet and Zen Master of the Heavy Sleep
Codename:Tuesday
02 8012 0953
0416 048 090
ICQ: 13107913



Reply via email to