Flex in the XML traversal

2010-04-01  来源:本站原创  分类:Flash  人气:255 

public static function Traversal(xml:XML, target:String):void{
                        var list:XMLList = xml.children();
                        for each( var xmlChildren:XML in list)
                        {
                                if(xmlChildren["xml The nodes in the  "] == target)
                {
                        // Locate the node after operation  ...
                        break;
                }
                if(xmlChildren.hasComplexContent())
                //hasComplexContent Determine whether the contents of the current node as a complex content, the return value is  true Or false-complex content refers to include child nodes  XML Object  .
                                {
                                        Traversal(xmlChildren,target);  // Recursive calls
                                }
            }
                }
XML object common attributes
Property Name

Property Classification

Property Description

ignoreComments

Notes and description attributes

Value ture or false, that is ignored when reading XML comments.

ignoreProcessingInstructions

Notes and description attributes

Value ture or false, that is ignored when reading XML description and introduction.

ignoreWhitespace

Blank

Value ture or false, indicating whether neglect XML content in pure white space.

prettyIndent

Format property

Value true or false, indicating whether the output into a string with restrict.

prettyPrinting

Format property

Value true or false, that there is a strict print output print format.

Common method of XML object
Method Name

Method of classification

Method Description

appendChild

Operating node Method

Add the node to the XML object's tail. Parameter is an XML object or XML expressions.

child

Operating node Method

XML object to return the child nodes, parameters for the child node name.

children

Operating node Method

XML object to return all the child nodes, return type XMLList type.

elements Operating node Method

XML object to return the child nodes or attributes, parameters for the child node or attribute name.

insertChildAfter

Operating node Method

Insert the node to the specified node, the parameters for the specified node.

insertChildBefore Operating node Method

Before inserting the node to the specified node, parameters for the specified node.

parent Operating node Method

Returns the current node the parent node.

prependChild Operating node Method

Back to the previous node the current node.

attribute Operating node Method

Return the specified attribute, parameters for the specified property name.

attributes Operating node Method

XML object to return all the properties.

hasComplexContent

Content How

Determine whether the contents of the current node for complex content, the return value is true or false. Complex content is included child node of XML objects.

hasSimpleContent

Content How

Determine whether the current node content simple content, return refers to the true or false. Simple content is the content of a single string.

toString Content How

The XML content object to a string output.

toXMLString Content How

Output for the XML string content.

copy Operating node Method

Copy of a copy of XML objects, the return value is the contents of the current node.

valueOf Operating node Method

Back to the contents of the specified node, including nodes that do not.

length Operating node Method

Returns the number of XML objects under a node.

ps: common attributes and methods from the "master Flex 3.0 - Implementation based on ActioScript 3.0"

相关文章
  • Flex in the XML traversal 2010-04-01

    public static function Traversal(xml:XML, target:String):void{ var list:XMLList = xml.children(); for each( var xmlChildren:XML in list) { if(xmlChildren["xml The nodes in the "] == target) { // Locate the node after operation ... break; } if(xm

  • flex Tree display xml file 2010-04-08

    I have a xml file as follows: <?xml version="1.0"?> <root> <field stuName="field1"> <field name="field2" /> <field name="field3" hide="yes" /> <field stuName="field4&q

  • Using an XML data provider with the Spark List control in Flex 4 2010-04-06

    Using an XML data provider with the Spark List control in Flex 4 by Peter DeHaan on NOVEMBER 4, 2009 in LIST (SPARK) , XML , XMLList , an XMLListCollection , BETA2 The following example shows how you can use an XML document as a data provider for a S

  • Pomer (Flex + BlazeDS + Hibernate + spring) framework 2009-05-07

    Pomer download and install Pomer Development Environment MyEclipse6.5 plug-in version flex3.0 JDK1.6.0_05 Mysql5.0 Tomcat 6.0 Pomer in Syria on environmental development, and test passed, but does not explain the above version of the environment is n

  • flex to write the clock 2010-02-11

    As the saying goes, a monk for one day, hit one of the three, I made a simple to use flex watch, code: <? Xml version = "1.0" encoding = "utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout=&quo

  • flex blazeds achieve server to use (specific identification) client pushing data (on consumer models) 2010-03-21

    Introduction: There are many similar stocks, foreign exchange, futures and other real-time quotes for this application, the client needs to display information such as price premiums. The current approach is: the client requests to the server time, r

  • Flex + spring + hibernate integration of video part_1 2010-03-29

    First video transmission up flex + spring + hibernatez integrated video, Follow the code and follow-up video transmission up. This example to explain about Flex + Spring + Hibernate (database using Hibernate communication) lcds I uploaded to my resou

  • with flex and java development. experimental remote calls. 2010-04-11

    First download the latest BlazeDS http://opensource.adobe.com/blazeds/ Download the latest BlazeDS. http://opensource.adobe.com/wiki/display/blazeds/Release+Builds The following began to use flex to create a web project with java in the. Create Proje

  • Flex + Struts2 + JSON submitted to the Ministry to achieve different 2010-04-22

    Flex + Struts2 + JSON code in the background which I say no more. See I do not know how to write an article on "Struts2 + JQuery + JSON Asynchronous interaction," the article, the background has not changed. In this talk focused on the realizati

  • Integration of Flex + Java configuration Posts 2010-05-05

    In sharing these types of configuration before a brief look at some of the resources used need. 1, MyEclipse + Flex plug-in (the official download) 2, Tomcat6.0 as a server (the official download) 3, with BlazeDS (free) instead of LCDS (charges): no

  • Flex-based Flex-config.xml command line compiler 2010-05-31

    Why should recommend ways to use flex-config.xml it, flex-config.xml flex compiler and other control covers all the options for the command line compiler, mxmlc compiler options for a complex command-line input is simply a nightmare and use of flex-c

  • Flex Player (for playing. Buffer curves show the progress bar and audio) 2010-07-14

    mx: ProgressBar buffer progress bar to achieve load songs ProgressBar mode has three modes, namely event, manual, polled, event-based event-driven mode, set the source object can be automatically loaded process; manual to manual mode, you need to cal

  • Flex 3 Getting Started (13): Building a simple user interface to control and use the cursor 2010-08-24

    Control the cursor Cursor using Adobe ® Flex ™ Manager, Flex applications can control the cursor image. For example, if the application requires the user to wait for the implementation of treatment until the deal had been completed, you can change to

  • Flex starts the sequence of events 2010-09-08

    Flex code 1. <? Xml version = "1.0" encoding = "utf-8"?> 2. <Mx: Application xmlns: mx = "http://www.adobe.com/2006/mxml" 3. Layout = "absolute" 4. Initialize = "init ()" 5. CreationComplete = &qu

  • flex and java communication Blazeds remoteObject 2010-09-16

    Said flex technology is fire, is the inevitable trend of the future of RIA development, will large-scale use, so ye also swept the busy, into one who, as a hedge, ha ha, nonsense is not to say. Begin actual flex and java communication, that the white

  • Get local file path Flex 2010-10-25

    1, Flex code section: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"> <mx:Script> <![CDATA

  • Flex data formatting and data validation 2010-11-05

    Flex data formatting and data validation Formatter class Formatter class in the Flex framework. This class will format the data into a string. All classes are mx.formatters.Formatter formatting subclass, including: · CurrencyFormatter (formatting cur

  • [Transfer] Flex Related Products 2010-11-09

    Flex related products <! - InstanceEndEditable -> <! - InstanceBeginEditable name = "contentBody" -> At present, an Adobe ® Flash ® Platform-based ecosystems, but also in its very wide range of sustainable growth that can help you su

  • flex scroll information (similar to the struts2 the marquee) 2010-11-15

    FLEX scrolling message system to do, like STRUTS2 inside the marquee tag struts2 Rolling Review: <ul> <marquee scrollAmount="2" height="50px" direction="up" behavior="scroll"> <s:iterator value="

  • Personal Flex Knowledge Base (2) 2010-11-18

    1, according to the state presents a different picture message <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" xmlns:DataGrid=&