e4x

Prepend XML Declaration to Flex e4x XML Object

How do you add an XML declaration - < ?xml version="1.0" encoding="UTF-8"? > - to a Flex XML object? The same thing you could do with the old XML - new XMLDocument class and the xmlDecl property. ...

Flex 4 E4X Filtering By Attributes Has Undefined Variable

I have some xml and I am trying to filter it using e4x. My e4x statement looks like this: model.config.source.fees..fee.(@min<amount).@amount My xml looks liks this: <flex> <fees> <fee type="credit" min="0.00" max="200.00" amount="6.00"/> <fee type="credit" min="200.01" max="370.00" amount="10.00"/> </fees> </flex> Whe...

Reading Non Standard Namespace XML using E4X in AS3?

Hey, I am trying to parse some XML in AS3 that I recieve thru a WebService call to C#. C# is serializing using a DataContract so the namespace is non standard. Here is what the xml looks like: <User xmlns="http://schemas.datacontract.org/2004/07/UserDatabaseManipulation.POCO" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt; ...

Updating an actionscript xml object directly in one line using e4x?

Given the following xml: <form> <personalDetails> <name>John</name> </personalDetails> <financeDetails> <income> <salary>1000000</salary> </income> </financeDetails> </form> I know that is it possible to create the above xml as follows (which is very cool): var xml:XML = <form />; x...

How do I add another sibling element in e4x?

If I want to create: <foo> <bar>example1</bar> <bar>example2</bar> </foo> using e4x, and I already have: foo.bar = <bar>example1</bar> How do I add the additional bar tag? ...

Select a Tree item

I'm working on a tree component using a XMLLIST as a data provider. <list> <menuItem label="Home" menuItemId="1" > <menuItem label="Info 1" menuItemId ="4"></menuItem> </menuItem> <menuItem label="Services" menuItemId="2" > </menuItem> <menuItem label="About" menuItemId="3" > </menuItem> </list> ...

Flash AS3: Using "string" to pass in E4X XML querry

I want to be able to do something like var XMLquerry:String = "a1.a2.a3"; var parserVal:XML = parserMethod(XMLquerry); // or var parserVal:XMLList = parserMethod(XMLquerry);` and get an output something like <a3>Some value</a3> Important: And I want to be able to replace the output at a1.a2.a3 so using decedents is out of question...

Converting string to E4X XML using Javascript

Using E4X, i can easily access nodes in XML using javascript as follows: <script language="javascript"> xmldata = <books><book><title>AA</title></book></books>; // notice the no string quotes alert(xmldata.book.title); </script> However, the application returning the data to me is returning XML as string. How can i access using this...

Programatically enable/disable menuBar buttons in Flex 4

I have the following XML in my Flex4 (AIR) project that defines the start of my menu interface: <mx:MenuBar x="0" y="0" width="100%" id="myMenuBar" labelField="@label" itemClick="menuChange(event)"> <mx:dataProvider> <s:XMLListCollection> <fx:XMLList xmlns=""> <menu label="File"> <item label="New"/> ...