SO xml namespace access

by pleclech forked from SO xml sortOn (diff: 27)
♥0 | Line 36 | Modified 2012-08-01 20:25:01 | MIT License
play

ActionScript3 source code

/**
 * Copyright pleclech ( http://wonderfl.net/user/pleclech )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/7XwU
 */

package {
    import flash.utils.ByteArray;
    import flash.utils.getQualifiedSuperclassName;
    import flash.utils.getQualifiedClassName;
    import flash.utils.describeType;
    import flash.utils.Dictionary;
    import flash.events.Event;
    import flash.utils.setTimeout;
    import com.bit101.components.TextArea;
    
    public class FlashTest extends TextArea {
        public namespace foo;
        foo var bar:String='baz';
        public function FlashTest() {
            width=400
            height=400
            setTimeout(doTest, 500)                        
        }
        public function doTest():void {
            var x:XML =
            <worksheet mc:Ignorable="x14ac"
             xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
             xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">
             <dimension ref="A1:F77"/>
            </worksheet>;   
            var ns:Namespace = x.namespace();
            trace('dim', x.ns::dimension.@ref);
            
            var ns2:Namespace=new Namespace("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
            trace('dim', x.ns2::dimension.@ref);
        }

        public function trace(...args):void {
            text=text+args.join(", ")+"\n"
        }
    }
}

Forked