vbscript:Get attribute from classic asp xml object into javascript

Norton

New Member
I`m having problem in getting an attribute from a xml object into JavaScript from classic asp. The following is my code:\[code\]if(len>0){<%for xx=0 to SNodes.length-1%>//asp code{ //Javascript codevar IXmlNode=xmlnewObj.createElement("I");IXmlNode.setAttribute("a",document.getElementById('a'+xx).value);IXmlNode.setAttribute("X","<%=SNodes.item(xx).getAttribute("PP")%>");xmlnewObj.documentElement.appendChild(IXmlNode); <% next %>//asp code}}\[/code\]Here \[code\]SNodes\[/code\] has xml like:\[code\]<tag><tag1 a="iii" PP="asdasdf"/><tag1 a="aaa" PP="asdasdf"></tag>\[/code\]Only this line is troubling me:\[code\]IXmlNode.setAttribute("X","<%=SNodes.item(xx).getAttribute("PP")%>");\[/code\]What is wrong with this line?
 
Back
Top