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
1
vote
1 answer

JavaScript + E4X: how to test if an element has text nodes?

In E4X, I know how to test if an element has a particular attribute, but how do I test if an element has text nodes? js>x = some random text some random…
Jason S
  • 184,598
  • 164
  • 608
  • 970
1
vote
2 answers

e4x query based on sub attributes

I'm trying to execute an E4X query (on the xml below) that will return all "accessor" nodes that contain a "metadata" node with a "name" attribute that equals "Required". I tried... type.accessor.(metadata.@name == "Required") ...but that only…
Christophe Herreman
  • 15,895
  • 9
  • 58
  • 86
1
vote
1 answer

XML Variables don't allow inspection in IntelliJ 11 Flex Debugger

I recently upgraded to IntelliJ 11 and the version 10 debugger used to allow for E4X / XML debugging. I was able to expand the children and inspect elements/attributes of XML but now I can't get that to work. Has something changed/broken? Does…
Adam Parrish
  • 439
  • 1
  • 5
  • 13
1
vote
1 answer

Getting xml:id attribute using XML object

I'm processing XML using Rhino 1.7R3 and have trouble accessing xml:id attribute. var bond = new XML('James Bond'); print(bond); // "James Bond" print(bond.@profession); //…
geca
  • 2,711
  • 2
  • 17
  • 26
1
vote
1 answer

Rhino 1.7r2-3 E4X "XML" is not defined

I couldn't run following code using JDK 6. It throws an exception: Exception in thread "main" org.mozilla.javascript.EcmaError: ReferenceError: "XML" is not defined. My environment is following: Ubuntu 11.04, JDK 6, Rhino 1.7R2 (also tested with…
shift66
  • 11,760
  • 13
  • 50
  • 83
1
vote
3 answers

Why can't I access xml nodes with out namespaces?

I've been banging my head on my desk for hours trying to figure out why I can't access the entry.author.name content? I've tried every possible way to access it but failed. But when I loop through all nodes with xml.children I see the author…
jspooner
  • 10,975
  • 11
  • 58
  • 81
1
vote
1 answer

E4X: Expression not returning what I expected

I have an XMLList, I am trying to grab one from the list with a stone attribute == Opal but its not working, I don't understand why? Here is the code: var xml:XML =
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
1 answer

Rhino E4X does not allow xml literal in {expression}

I am using rhino1_7R2. I have found that the following program causes syntax error(illegally formed XML syntax): function b(node) { return {node}{node}; } a=foo {b(
bar
)} baz
; alert(a); but it…
hoge1e3
  • 802
  • 5
  • 15
1
vote
3 answers

How can I tell if E4X expression has a match or not?

I am trying to access an XMLList item and convert it to am XML object. I am using this expression: masonicXML.item.(@style_number == styleNum) For example if there is a match everything works fine but if there is not a match then I get an error…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
1 answer

How to access the value of an XML attribute using a String variable? How can this be applied to filtering?

Using e4x in flex: var attr : String = "foo"; var xml : XML = ; How can I use the variable "attr" to access xml.node.@foo I thought I could do it with xml.node.@[attr] But this doesn't…
pclem12
  • 449
  • 10
  • 23
1
vote
1 answer

E4X: List document namespaces?

How would I get a list of namespaces in an XML document using E4X?
David Wolever
  • 148,955
  • 89
  • 346
  • 502
1
vote
2 answers

Adobe Campaign: Javascript XML E4X Switch Case

Given the following table data model in Adobe Campaign I have developed the following script, which is a mix of javascript, xml, e4x (used by adobe campaign). The script basically iterates through each line and executes for each switch the code…
David Garcia
  • 3,056
  • 18
  • 55
  • 90
1
vote
1 answer

What's the difference in E4X between the elements() and children() method

I'm currently working with Javascript Rhino and E4X. Is there a difference between using elements() and children() besides the possibility to use an additional argument in the elements method to get only elements with that name. Example: new…
Aeonnex
  • 31
  • 6
1
vote
1 answer

What browsers are currently supporting E4X(to give direct support for XML to JavaScript)

I heard E4X; a New extension to the javascript gives direct support for XML to JavaScript. Please tell me currently what browsers have support for this.
Reddy
  • 1,327
  • 3
  • 23
  • 44
1
vote
2 answers

Editing XML in Flex using e4x

In Flex, I have an xml document such as the following: var xml:XML = value1value2value3 At runtime, I want to create a TextInput control for each node under root, and have the values bound to the…
Grokys
  • 16,228
  • 14
  • 69
  • 101