Questions tagged [e4x]

E4X was an extension to ECMAScript which allowed for native handling of XML.

ECMAScript For XML (E4X) was an extension to ECMAScript which allowed use of XML literals, as well as accessors and filters for working with such XML. Its ability to allow embedding of JavaScript also was convenient for building XML-based templates.

Standardized in ECMA-357, it was supported in Mozilla's Spidermonkey and Rhino Javascript engines, and was included in the Firefox web browser between versions 1.5 and 20.

Warning: E4X is obsolete. It has been disabled by default for webpages (content) in Firefox 17, disabled by default for chrome in Firefox 20, and has been removed in Firefox 21. Use DOMParser/DOMSerializer or a non-native JXON algorithm instead.

More information can be found at https://developer.mozilla.org/en/e4x

260 questions
2
votes
2 answers

find out if AS3's XMLList contains string as node value

Is there an XMLList equivalent to Array.indexOf? For example - var array:Array = ['one','two']; trace(array.indexOf('two')); // returns 1, since it's at the second position trace(array.indexOf('three')); // returns -1, since it isn't found ...…
matt lohkamp
  • 2,174
  • 3
  • 28
  • 47
2
votes
1 answer

getElementsByTagName in E4X

I'm searching a possibility to get an array of elements in E4X for an unknown tagname (like the DOMs getElementsByTagName) inside of a function. My first thought was something like: (function (doc, tag) { return doc..[tag]; }) Is there any…
fb55
  • 1,197
  • 1
  • 11
  • 16
2
votes
1 answer

Can't parse XML AS3 in flash with namespaces

I don't understand why I can't parse these datas:
Fred
  • 399
  • 3
  • 12
2
votes
1 answer

Changing date format in Pentaho using javascripting

I have an input excel sheet which has a field "fail_date". I want to change the format to dd.MM.yyyy HH:mm:ss. I am doing this in javascript shown below. var temp = fail_date.getDate(); str2date(temp,"dd.MM.yyyy HH:mm:ss"); But I get the below…
tester
  • 213
  • 6
  • 20
2
votes
1 answer

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 = special-name could not be…
Jonas
  • 2,910
  • 2
  • 26
  • 36
2
votes
1 answer

How do you delete an attribute in XML?

How do I delete an attribute on an XML node in E4X? I thought this would be easier but I haven't found any examples. I tried: delete xml.attribute("myAttribute"); which gives me the following error: TypeError: Error #1119: Delete operator is not…
1.21 gigawatts
  • 16,517
  • 32
  • 123
  • 231
2
votes
2 answers
2
votes
2 answers

E4X XML filtering and only one result

Consider this XML: 123 abc abc This works, because E4X only finds 1 match, and returns an…
Pier
  • 10,298
  • 17
  • 67
  • 113
2
votes
4 answers

JavaScript / Rhino: Can I use a regular expression in an E4X query to select certain nodes only?

I'm working on Rhino (Mirth), and I've got to process / parse an XML with the following structure: ... ...
user192522
2
votes
2 answers

Flex 4: XML Literals with conditions

Is there any way to do something like the following (pseudocode) in Flex: var x:XML = if(condition){ hello } ; which would return hello if the condition was true and (or ) if…
Eduardo
  • 8,362
  • 6
  • 38
  • 72
2
votes
1 answer

How do I import this Greasemonkey script, that uses CDATA, to Chrome?

I've got following code that works fine on Greasemonkey but not in Chrome: // ==UserScript== // @name SO // @namespace stackoverflow.com // @include *stackoverflow.com/* // @version 1 //…
Vloxxity
  • 980
  • 1
  • 9
  • 30
2
votes
1 answer

Performing image scraping using YQL with lowest resources usage possible i.e. lowest number of queries

I am trying to perform some image scraping tool which enables the user to scrape all the images contained within a given page using xpath process the scraped images to find which have an alt tags and which doesn't and return the result as two…
Mohammed Ibrahim
  • 550
  • 1
  • 5
  • 15
2
votes
1 answer

Javascript E4X: Select a node based on an attribute value

Consider this scenario: Using Javascript/E4X, in a non-browser usage scenario (a Javascript HL7 integration engine), there is a variable holding an XML snippet that could have multiple repeating nodes. Barney
p.campbell
  • 98,673
  • 67
  • 256
  • 322
2
votes
1 answer

CouchDB & E4X for documents containing XML

I have a CouchDB database (v1.2.0) with documents like: { "_id": "pages/1", "_rev": "15-56ad5a5e879206edb04a7a62105dd25d", "content": "Page Title" } According to this article I should…
lalibi
  • 3,057
  • 3
  • 33
  • 41
1
vote
2 answers

Get last appearance of a node

Given Data to be overwrited Normal data Actual data I want to get the last crazyNode (the one which contains Actual data). I know how to…
Jorjon
  • 5,316
  • 1
  • 41
  • 58