Hello list;

My tests have shown that the child() method on an XML document returns
children in the anonymous namespace, even if a namespace is specified in
the argument to child(). Can anyone confirm that this behavior is
correct? It seems wrong to me.

     var x : XML =
     <ns:x xmlns:ns="foo.bar.com">
      <ns:foo/>
      <ns:foo/>
      <ns:foo/>
     </ns:x>;

     var x2 : XML =
     <x>
      <foo/>
      <foo/>
      <foo/>
     </x>;

     var n  : QName = new QName( "foo.bar.com", "foo" );
     var n2  : QName = new QName( "bim.bam.com", "foo" );

     trace( x.child( n ).length() );  // output -> 3
     trace( x.child( n2 ).length() ); // output -> 0
     trace( x2.child( n ).length() ); // output -> 3
     trace( x2.child( n2 ).length() ); // output -> 3


Reply via email to