var obj = new Object();
obj.child_id = [];
obj.id = this.xml_id++;
- obj.level = level;
- var att_list = [];
+ obj.level = level+1;
- obj.att_list = [];
var render_name = "<" + tag;
- var xml_tag = "<" + tag;
+ obj.att_list = [];
+ obj.att_list.push(tag);
$(xml).each(function() {
- att_list = this.attributes;
- att_list = _.select(att_list, function(attrs) {
- xml_tag += ' ' + attrs.nodeName + '=' + '"' + attrs.nodeValue + '"';
- if (tag != 'button') {
- if (attrs.nodeName == "string" || attrs.nodeName == "name" || attrs.nodeName == "index") {
- render_name += ' ' + attrs.nodeName + '=' + '"' + attrs.nodeValue + '"';
- }
- } else {
- if (attrs.nodeName == "name") render_name += ' ' + attrs.nodeName + '=' + '"' + attrs.nodeValue + '"';
- }
- });
- render_name += ">";
- xml_tag += ">";
+ _.each(this.attributes, function(attrs){
+ if (tag != 'button') {
+ if (attrs.nodeName == "string" || attrs.nodeName == "name" || attrs.nodeName == "index") {
+ render_name += ' ' + attrs.nodeName + '=' + '"' + attrs.nodeValue + '"' ; }
+ } else {
+ if (attrs.nodeName == "name") {
+ render_name += ' ' + attrs.nodeName + '=' + '"' + attrs.nodeValue + '"'; }
+ }
+ if (attrs.nodeName != "position") {
+ obj.att_list.push( [attrs.nodeName,attrs.nodeValue] );
+ }
+
+ });
+
+ render_name+= ">";
});
- obj.main_xml = xml_tag;
obj.name = render_name;
return obj;
},