Parsing XML with ASP

前端 未结 2 2099
感情败类
感情败类 2021-01-27 11:41

I have the code below, I just need help on figuring out the best way to get html from the content node below instead of plaintext. Any help is much appreciated.



        
2条回答
  •  一个人的身影
    2021-01-27 12:39

    You can get the XML of a node using the xml property instead of the text property you are using now:

        dim o_xml, o_node
        set o_xml = Server.CreateObject("Msxml2.DomDocument")
        o_xml.load("books.xml")
        set o_node = o_xml.selectSingleNode("//catalog/book[@id='bk102']")
        Response.Write Server.htmlEncode(o_node.xml)
    

    Docs here: http://msdn.microsoft.com/en-us/library/ms755989%28v=vs.85%29.aspx

提交回复
热议问题