var strXML="
Little Pig27 Xiaoxia26Xiaozhang 25";
var XMLObj=new XMLObject();
XMLObj.LoadXMLForString(strXML)
//XMLObj .getXMLForURL("test.xml");
var list = XMLObj.getXMLArray( 'user');//Get the node
document.write(XMLObj.getNodeValue('ekuy.user .name.cnname'));//Get the node content directly
//Loop the node to get the child node content under the node
for(var i=0; i
var obj = list[i];
document.write(XMLObj.getValue(obj, 'name.cnname'));
document.write(XMLObj.getValue(obj, 'age'));
document.write('
');
}
Haha, it’s not very well written. It’s a very simple function that everyone laughs at.