Demo entry 6631310

py

   

Submitted by lu on Jul 13, 2017 at 05:04
Language: Python. Code size: 913 Bytes.

        var index = row.fieldIndex("Properties");
        if (index != -1 && row.getValue(index) != undefined) {
            var bety = row.getValue(index).asString();//
            bety = bety.replace('l version="1.0" encoding="UTF-8" standalone="yes" ?>', '');//xml排版错误 需要把字符串去掉头部再解析
                    xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
                    xmlDoc.async = "false";
                    xmlDoc.loadXML(bety);
                    if (xmlDoc.parseError.errorCode != 0) {
                        alert(xmlDoc.parseError.reason);
                        return;
                    }
                    var nodes = xmlDoc.documentElement.childNodes;
                    for (var i = 0; i < nodes.length; i++) {
                        var node = nodes[i];
                        alert( node.attributes[1].text + ":" + node.text )//读取属性;
                    }
      }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).