first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

ActionScript 3.0 and E4X Code: Remove a Namespace; XSPF

public static function getTrackData(data:*, index:int=0):XML { var xspf:Namespace = new Namespace(xspfUri); default xml namespace = xspf; var playlist:XML = new XML(data);

    var length:int = playlist.trackList.length();
    var title:String = String(playlist.trackList.track[index].title);
    var location:String = String(playlist.trackList.track[index].location);

    var returnXml:XML =
        <trackData x­mlns="">
            <total>{length}</total>
            <title>{title}</title>
            <location>{location}</location>
        </trackData>

    return returnXml;
}

/*

By setting x­mlns to a zero-length string, E4X will omit the x­mlns attribute.

*/

mod date: 2008-12-05T04:44:46.000Z