utl.js
代码如下:
function createXmlTree(node, indent) {
if (node == null)
return "";
var str = "";
switch (node.nodeType) {
case 1: // Element
str += "div class='element'span class='elementname'" + node.nodeName + "/span";
var attrs = node.attributes;
for (var i = 0; i attrs.length; i++)
str += createXmlAttribute(attrs[i]);
if (!node.hasChildNodes())
...[ 查看全文 ]