Get prefix and uri from a namespace : Namespace : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » Namespace »

 

Get prefix and uri from a namespace


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var example:XML = <example xmlns:test="http://foo.com/">
                             <test:element>Lorem Ipsum</test:element>
                          </example>;
        var test:Namespace = example.namespace("test");
        trace(test.prefix)// Displays: test
        trace(test.uri)// Displays: http://foo.com/


    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo XML
» Namespace