zoukankan      html  css  js  c++  java
  • 【AS3代码】XML操作

    package
    {
        import flash.display.Sprite;

        public class Main extends Sprite
        {    
            
            public function Main():void
            {
                init();
            }
            private function init():void
            {
                var foo:String =                 
                    "<websites>" +
                    "<site name='Kingda blog' url='http://www.kingda.org'>" +
                    "<pageview>100000</pageview>" +
                    "</site>" +
                    "<site name='ActionScript3' url='http://www.actionscript3.cn'>" +
                    "<pageview>4500</pageview>" +
                    "</site>" + 
                    "</websites>";
                
                var kingdaXML:XML = new XML(foo);
                
                kingdaXML.site[0].author = new XML();
                
                //添加空白新节点
                kingdaXML.site[0].author = "新节点值";
                
                //添加一个属性
                kingdaXML.site[0].author.@uu = "属性值";
                
                //再天津爱一个location节点并赋值
                kingdaXML.site[0].location = "AAAAAAAAAAA";
                
                //将新添加的location节点删掉
                delete kingdaXML.site[0].location;
                
                
                trace(kingdaXML);
                
                //查找值小于50000的pageview子元素
                trace(kingdaXML.site.(pageview < 50000));
                
                //查找值等于Kingda blog的属性name子元素
                trace(kingdaXML.site.(@name == "Kingda blog"));
                
            }
        }
    }
  • 相关阅读:
    mapcontrol的鼠标样式
    SQL SERVER数据类型与C#数据类型对照表
    正则表达式基元
    WPF中UserControl和DataTemplate
    [转]SQL三种获取自增长的ID方法
    [转]SQL Server 存储过程 一些常用用法(事物、异常捕捉、循环)
    Learn JavaScript(面向对象的程序设计01)
    CLR:基元类型、引用类型和值类型
    grid layout 相关代码
    css关于position的几个值
  • 原文地址:https://www.cnblogs.com/kingfly/p/2589839.html
Copyright © 2011-2022 走看看