Two Namespace objects are considered equal if, and only if, they have the same namespace name, regardless of their prefix. : namespace « XML « Flash / Flex / ActionScript






Two Namespace objects are considered equal if, and only if, they have the same namespace name, regardless of their prefix.

 

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

        var product:XML = <someCorp:PRODUCT
                             xmlns:someCorp="http://www.example.com/someCorp">
                             <someCorp:PRICE>99.99</someCorp:PRICE>
                           </someCorp:PRODUCT>;
        var ns1:Namespace = product.namespace("someCorp");
        var ns2:Namespace = new Namespace("sc", "http://www.example.com/someCorp");
        trace(ns1 == ns2);  // Displays: true


    }
  }
}

        








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.Working with Namespaces in ActionScript
8.Namespace with prefix
9.Namespace objects return their URI value by default when the toString() method is used
10.Get prefix and uri from a namespace
11.Use the namespaceDelarations() method to return an Array of all the namespaces defined for a given element.
12.Using the :: Operator with namespace