xml节点问题
<?xml version="1.0"?><root> <status>ok</status> <body><root><prozl>1</prozl><prol><div><a href="/webcn/UploadFiles/Shop/201001201456080338.jpg" target="_blank" class="highslide" onclick="return hs.expand(this)"><img src="/webcn/UploadFiles/Shop/201001201456080338.jpg" border="0" onerror="this.src='/webcn/UploadFiles/nopic.gif'" /></a><div class="highslide-heading">7CF钛金尊品离子蜡</div></div><div class="newP_Info"><a href="/webcn/Item/945.aspx" target="_blank">7CF钛金尊品离子蜡</a><br />价格:<strong>¥230.40×1</strong></div></prol></root></body> <pagename/> <total>1</total> <currentpage>1</currentpage> <pagesize>0</pagesize></root>
function load(url){ var dom=false; if(document.all)dom=new ActiveXObject("microsoft.xmldom"); else if(document.implementation&&document.implementation.createDocument)dom=document.implementation.createDocument("","",null); dom.async=false; dom.load(url); return dom;}var dom=load("x.xml"),prol=dom.getElementsByTagName('prol'),prozl=dom.getElementsByTagName('prozl');alert(prozl[0].firstChild.nodeValue)//prozlvar tmp=document.all?prol[0].xml:new XMLSerializer().serializeToString(prol[0]);tmp=tmp.replace('<prol>','').replace('</prol>','');//替换掉首尾节点字符串alert(tmp)