Friday, February 5, 2010

[jQuery] Re: A different approach to parsing XML, and a little help on processing attributes more efficiently

OK got non-standard attributes. It forces one rule, that all non-
standard attributes for an element must follow 'id' and 'label'. This
is standardized in setting "var z=2", as it skips past the first
attributes and finds the remaining. Though this is a lot of code for
each level of elements;

var attribs = $parent[0].attributes
attrb=[];
for (var z = 2; z < attribs.length; z++) {
attrb.push(attribs[z].name +":"+ attribs[z].value)
}
console.log(attrb)

No comments: