e4x

How do I create variable paths using e4X?

I need to know how I can parse a variable path in Flex 3 & e4X. For example, I have two XML strings where the name of one element is the only difference. <NameOfRoot> <NameOfChild1> <data>1</data> </NameOfChild1> </NameOfRoot> <NameOfRoot> <NameOfChild2> <data>2</data> </NameOfChild2> </NameOfRoot> Cu...

How do I filter out secific nodes of XML?

Take this XML example: <root> <grandParent GPid="1" hidden="false"> <parent Pid="1" hidden="false"> <child Cid="1" hidden="false"/> <child Cid="2" hidden="true"/> </parent> <parent Pid="2" hidden="false"> <child Cid="3" hidden="false"/> <child Cid="4" hidden="false"/> </parent> </grandParent> ...

E4X get element's next sibling

Hey, I have a reference to a XML node which is part of a bigger XML tree. Is there a way to get that elements next/previous sibling without accessing the parent and looking for it? Something like DOM's nextSibling would be what I look for. edit: Given that there is no natural way to do this with E4X, I'll just stick to the following (e...

Cannot assign to a non-reference value

Hello everybody, I have a strange problem, I have a XMLList with elements who have the attribute position from 0 to x. When I want to add text to a element of that XMLList by the following statement, I get a error message: textElements.(@position == columnIndex) = "anyString"; 1050: Cannot assign to a non-reference value. What i...

Ignoring case on E4X node names and attributes?

Does anyone know of a trick to ignore upper/lower/camelcase on XML node names and attributes? A quick example: I give an XML file to my client which contains an XML attribute named fooID but the client could change the XML, and - not being aware of upper/lowercaseness change or add an attribute under 'fooid'. Naturally my parser (in AS3...

Why am I getting this warning: 3594: parent is not a recognized method of the dynamic class XML?

It's coming from this line of code: var dropTargetXML:XML = XMLTemplate.template.component.section.question.(@question_questionID == nNode.parent().@question_questionID)[0]; nNode is an XML node sent as an argument to the function this is called in. The code runs, and does everything expected but the compiler sends out that warning. D...

XML Parsing issue in Flex

Hi, I have an XML with more than 10,000 lines,when i am parsing that xml using URLLoader class.i am unable to trace the entire xml.While tracing i am getting xml from the middle.can anyone suggest me how to parse the xml document. Thanks in Advance ...

Flex XML dynamic type

I have an application which receives dynamic XML data from a server. The structure of the XML is dynamic and the tags/attribute names cannot be predicted. NO row items can be hardcoded. The data is coming back from a database (imagine columns and rows), and the type of the data is known on the server side. The following is just an ex...

Parsed XML Printing Using E4X: Inconsistent Results?

I'm trying to parse an XML file of tweets as retreived from Twitter's restful API (http://apiwiki.twitter.com/Twitter-REST-API-Method:-statuses-user_timeline). The issue is, when I print it using: tweetTextArea.text += xml..text; I get the tweets. However, when I try the following, I get just numbers: // Print all tweets. for (var t...

E4X browser support

I'm trying to figure this out, but there's not much information. Which browsers support E4X, and why isn't it more widely adopted? ...

XML literals in JavaScript?

E4X (Ecma-357) is an extension to ECMAScript that adds XML literals as first-class primitives. That's awesome, but with only Mozilla and Adobe support (without V8 and IE support too), E4X is virtually dead from a web developer's perspective that has to support users with any modern browser. What other work is being done around implemen...

Filter 2 different nodes in E4X?

Can I filter 2 different node types in E4X same as attributes but then on node type? I cannot find this anywhere: Something like": $.book_xml.pages.page.(node == 'front' && node =='back'); <pages> <page> <front></front> <back></back> </page> <pages> ...

Converting xml attribute to array

In the following XML: <myxml> <photos> <photo url="1.jpg"/> <photo url="2.jpg"/> <photo url="3.jpg"/> <photo url="4.jpg"/> </photos> </myxml> How do I use e4x to extract the urls and push them in an array with the least possible code? ...

External XML and AS3

I want to pass external XML a variable. How do I do this? WHAT I'M AFTER - update my variable with COUNT XML WHAT I'M NOT GETTING - The integer to String values - How to pass XML to a variable link http://videodnd.weebly.com/ time.xml <?xml version="1.0" encoding="utf-8"?> <SESSION> <COUNT TITLE="starting position">-77777</COUN...

Overwrite msg in mirth

I have two destinations now and the first calls a SOAP webservice. I want to take the response of that destination by: msg = new XML(responseMap.get('Destination1').getMessage()); and convert it to a mutable XML object. Doing: logger.error(msg); <S:Body><PRPA_IN201306UV02> ... </PRPA_IN201306UV02></S:Body> Shows the valid msg as I...

reciving an Element object from rhino when using e4x

hi, i have a java object called myObject with function foo(Element e) that i am binding to the rhino context. in the script i am creating an XML using E4X, my question is how can i would pass this XML object as a parameter to foo? there is one solution to work with Strings something like: var data = new XML(); //Set data using E4X da...

how to strip namespaces with e4x?

I have an arbitrary XML document provided by a URL. I also have an xpath-like expressions. var xml = <doc><node1><node2><node3>some value</node3></node2></node1></doc>; var path = "node1.node2.node3"; I need to verify if the above path into the XML is valid. I tried to do this using eval and E4X. var value = eval("xml."+path); Ho...

traversing ECMAScript for XML (E4X) - tutorial or example please?

Hi there I am using AS3 to traverse through XML but the Flash help is really insufficient here. Do you know any easy-to-read tutorial on how to traverse E4X in for loops or similar? (I don't think the question is Flash or AS3 specific as long as the tutorial is easy to understand) Thanks! ...

Accessing E4X nodes having special characters in name without breaking binding chain in flex.

I am using E4X to bind some values from xml in flex 3. There is a problem when xml tag's (or attribute's) name has special character in it: having xml content var xml:XML = <tag> <special-name att="val" /> </tag> special-name could not be accessed using xml.special-name.@att because it is interpreted as subtraction, on the other ...

e4x vs XPath: Which one to use when going with action script programming in Flex?

e4x programming extension is native to Actionscript and makes sense to use it over Xpath or any other DOM interfaces. I would like to know from flex community if they had any bad experiences like performance, etc, or any other gotchas. ...