Using the :: Operator with namespace : namespace « XML « Flash / Flex / ActionScript






Using the :: Operator with 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>L I</test:element>
                             <test:element test:attribute="D S A" />
                          </example>;
        var test:Namespace = example.namespace("test");
        trace(example.test::element[0]);

    }
  }
}

        








Related examples in the same category

1.Create a namespace
2.Create a reference to the default Namespace using the Namespace constructor:
3.As with element and attribute names, we can use the properties wildcard (*) with namespaces.
4.Creating Namespace-Qualified Elements and Attributes
5.Working with XML Namespaces
6.Get xml namespace
7.Two Namespace objects are considered equal if, and only if, they have the same namespace name, regardless of their prefix.
8.Working with Namespaces in ActionScript
9.Namespace with prefix
10.Namespace objects return their URI value by default when the toString() method is used
11.Get prefix and uri from a namespace
12.Use the namespaceDelarations() method to return an Array of all the namespaces defined for a given element.