:: Home >>

Loading XML string in Mozilla

The code below refers to version 1.0 - fixed in 1.0.1 release.

Loading XML string into Active.XML.Table is broken in Mozilla. You have to apply the following patch to make it working:

Active.XML.Table.prototype.setXML = function(xml){

    if (!xml.nodeType) {
        var s = "" + xml;
        if (window.ActiveXObject) {
            xml = new ActiveXObject("MSXML2.DOMDocument");
            xml.loadXML(s);
            xml.setProperty("SelectionLanguage", "XPath");
        }
        else {
            xml = (new DOMParser).parseFromString(s, "text/xml");
        }
    }

    if (this._namespaces) {xml.setProperty("SelectionNamespaces", this._namespaces);}

    this._xml = xml;
    this._data = this._xml.selectSingleNode(this._dataPath);
    this._items = this._data ? this._data.selectNodes(this._itemPath) : null;
    this._ready = true;
};

Comments

2 Oct 05
Loading XML data from a string var Henk (7)
11 May 05
Bug: loading XML string in Mozilla Alex (ActiveWidgets) (1)
13 Nov 04
Regarding the commercial version of the control... Jagadeesh VN (6)
6 Nov 04
Regarding setRows and setXML Jugs (0)
30 Mar 04
Loading dynamic XML into table Arun (2)

Comments will appear on this page and in the main forum.

Documentation:

Recent changes:

2.5, 2.5.1
2.5.1
2.5
Release History
2.5
2.0.2
textToValue
textToData
dataToValue
dataToText