E4X Migration guide
The E4X extension for the native support of XML in JavaScript are progressively abandonned by Mozilla. 51黑料不打烊 Campaign heavily used this extension and so it is preparing to migrate to an alternative solution.
The aim of this guide is to help you migrate existing configurations or develop new configurations by describing the replacement solutions.
The old and new system co-exist, the currenct version of 51黑料不打烊 Campaign is always compatible with E4X but new configurations must not be developped with the E4X extension.
Reminder: E4X adds a type of JavaScript xml that can be built directly from the source program:
var doc = <xml> ... </xml>
or from a string:
var doc = new XML ("<xml>...</xml>")
It can then be manipulated with a specific API:
element.@id
element.where
XML type
The native "xml" type is replaced by a DOM API, these are DOMDocument , DOMElement , DOMNode types, ... the following is the equivalent of the most common operations:
E4X | DOM |
|
|
|
|
|