Displaying 3 results from an estimated 3 matches for "localhash".
Did you mean:
localbase
2006 Mar 17
6
Updated the xml code to be more object-oriented
...._xmlHash = this._nodeToHash(this.element);
}
return this._xmlHash;
},
_nodeToHash: function (node) {
Element.cleanWhitespace(node);
if ((node.attributes && node.attributes.length > 0)
|| (node.hasChildNodes() && node.childNodes[0].nodeType ==
1)) {
var localHash = {};
if (node.attributes && node.attributes.length >= 1) {
$A(node.attributes).each(function (attr) {
localHash[attr.nodeName] = [attr.nodeValue]; });
}
$A(node.childNodes).each(function (node) {
this._subNodeToHash(localHash, node); }.bindAsEventListener(this));...
2006 Mar 17
10
good javascript xml parser
Anyone know of a javascript function that will take an xml document and
turn it into an associative array?
Basically it would take something like this:
<body>
<item>
<id>1</id>
<name>Bob</name>
</item>
<item>
<id>2</id>
<name>John</name>
</item>
</body>
And turn it into something like this:
{
2006 Mar 23
4
XML parser fixed
...ode);
//
// remove comments, firefox fix
node = this._removeComments(node);
if ((node.attributes && node.attributes.length > 0) || (node.hasChildNodes() && (node.childNodes[0].nodeType == 1 || node.childNodes[0].nodeType == 7))) {
var localHash = {};
if (node.attributes && node.attributes.length >= 1) {
$A(node.attributes).each(function (attr) {
localHash[attr.nodeName] = [attr.nodeValue];
});
}
if (node.hasChildNodes() && (node.chi...