I like to be able to parsing the value like asp.net, unfortunately the asp classic also return the tag like the <div>everything within it</div> tag.
I am trying to parse the path “/root/div” and return everything within it, not including the “<div></div>“, the result should be “<p>abc <span>other span</span></p>“
<%
Set CurrentXML=Server.CreateObject("Microsoft.XMLDOM")
CurrentXML.LoadXml("<root><div><p>abc <span>other span</span></p></div></root>")'Load string into CurrentXML
Response.Write("<BR>"&Server.HTMLEncode(CurrentXML.SelectSingleNode("/root/div").XML)) 'I want to return without the div, the correct result should be <p>abc <span>other span</span></p>
%>
Try this:
Unfortunately the MSXML DOM elements do not have an innerXml property. Hence you need to the loop as exemplified about to concatenate the xml of each child node to genereate the inner XML of an element.