这几天在用flex做流程设计器时,遇到了需要删除XMl节点的问题,在网上搜了一下,有一种方案是将整个XML树重新构造一遍,在构造时将要删除的节点排除。这种方法对于流程设计器代价太高。无奈之下只好忍着头痛去Adobe的网站上看看E文去,终于黄天不负有心人,终于找到了,实例代码如下,下面的代码我测试过,可以正确运行
Title
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
width="440" height="400"
initialize="initializeHandler();"
>
<mx:Script>
<![CDATA[
[Bindable] public var a:XMLList;
[Bindable] public var b:XMLList;
[Bindable] public var c:XMLList;
[Bindable] public var d:XMLList;
// Model: XML structure describing
// some of the books in my collection.
[Bindable]
private var myBooks:XML =
<books>
<book ISBN="1590595181">
<title>Foundation ActionScript Animation: Making Things Move</title>
<author>Keith Peters</author>
<amazonUrl>http://tinyurl.com/npuxt</amazonUrl>
<pageCount>470</pageCount>
</book>
<book ISBN="1582346194">
<title>Send in the Idiots: Stories from the Other Side of Autism</title>
<author>Kamran Nazeer</author>
<amazonUrl>http://tinyurl.com/lo5ts</amazonUrl>
<pageCount>500</pageCount>
</book>
</books>
private function initializeHandler():void
{
// An XML list that contains both book nodes.
a = myBooks.book;
// Keith Peters
b = myBooks.book[0].author;
// 470
c = myBooks.book.(@ISBN=="1590595181").pageCount;
// Delete the first book node.
delete myBooks.book[0];
// Send in the Idiots...
d = myBooks.book[0].title;
}
]]>
</mx:Script>
<!-- User interface -->
<mx:Panel
title="XML lookup results"
paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">
<mx:Text text="{'a: ' + a}" width="300"/>
<mx:Label text="{'b: ' + b}"/>
<mx:Label text="{'c: ' + c}"/>
<mx:Label text="{'d: ' + d}"/>
</mx:Panel>
</mx:Application>
分享到:
相关推荐
Ajax struts2 xml flex Ajax struts2 xml flex Ajax struts2 xml flex Ajax struts2 xml flex Ajax struts2 xml flex Ajax struts2 xml flex
Flex之URLLoader加载XML 使用URLLoader加载XML
Flex与JSON及XML的互操作,一篇Info的文章。
flex通过httpService读取xml数据到datagird中,通过读取远程URL的XML数据(这里保存到本地),保存到ArrayCollection中,然后在将ArrayCollection绑定到datagird上 环境:flex3.0 可直接运行
修改后的flex-config.xml文件 博文链接:https://swingchen.iteye.com/blog/131936
flex 读XML 写XML 并保存为xml文件,由图生成Xml文件,由XMl文件生成图
flex 的xml操作xml操作xml操作xml操作xml操作xml操作xml操作xml操作
flex解析xml
使用httpService通过xml传递对象的时候,用于flex端解析xml的实例。
flex读取xml文件的数据的三种方式及其比较
IBM Flex System x440 Compute Node
用于flex代码注释的模板xml文件。只要导入,这个文件,每次在新建完as类后,就会自动生成类注释。
NOTHING Flex使用json和xml数据交互
flex外部读取xml
flex语言编写的,把xml内容存成xml文件保存到指定的位置!
flex中经常需要xml格式的文件。通过后台asp.net的处理可以将数据库中读取的文件转化为xml格式。这是再传递给前端的flex中的tree控件作为数据源。
IBM Flex System V7000 Storage Node Introduction and Implementation Guide
flex解析xml实例,可读取xml标签来获取信息,并附表情
NULL 博文链接:https://xaajie.iteye.com/blog/379054