Two QName instances are considered equal if their namespace name and local names both match. : QName « XML « Flash / Flex / ActionScript






Two QName instances are considered equal if their namespace name and local names both match.

 


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 someCorp:Namespace = product.namespace("someCorp");
        var qn1:QName = new QName("http://www.example.com/someCorp", "PRICE");
        var qn2:QName = product.someCorp::PRICE.name(  );
        
        trace(qn1 == qn2);  // Displays: true
    }
  }
}

        








Related examples in the same category