ASP parsing xml file
Sub GetUserInfo ()
Dim Rs,sql
Xmldoc.loadxml "<root><appid>dvbbs</appid><status>0</status><body>< Message/><email/><question/><answer/><savecookie/><truename/><gender/> <birthday/><qq/><msn/><mobile/><telephone/><address/><zipcode/>< homepage/><userip/><jointime/><experience/><ticket/><valuation/><balance/ ><posts/><userstatus/></body></root> "
SQL = "SELECT top 1 * nc_user WHERE username= '" & Newasp.checkbadstr (UserName) & "'"
Set Rs = Newasp.execute (SQL)
If not rs.eof and not rs.bof Then
XmlDoc.documentElement.selectSingleNode ("Body/email"). Text = Rs ("Usermail") & ""
XmlDoc.documentElement.selectSingleNode ("Body/question"). Text = Rs ("question") & ""
XmlDoc.documentElement.selectSingleNode ("Body/answer"). Text = Rs ("Answer") & ""
XmlDoc.documentElement.selectSingleNode ("Body/gender"). Text = Rs ("Usersex") & ""
XmlDoc.documentElement.selectSingleNode ("Body/birthday"). Text = ""
XmlDoc.documentElement.selectSingleNode ("Body/mobile"). Text = ""
XmlDoc.documentElement.selectSingleNode ("Body/userip"). Text = Rs ("Userlastip") & ""
XmlDoc.documentElement.selectSingleNode ("Body/jointime"). Text = Rs ("Jointime") & ""
XmlDoc.documentElement.selectSingleNode ("Body/experience"). Text = Rs ("Experience") & ""
XmlDoc.documentElement.selectSingleNode ("Body/ticket"). Text = ""
XmlDoc.documentElement.selectSingleNode ("Body/valuation"). Text = Rs ("Userpoint") & ""
XmlDoc.documentElement.selectSingleNode ("Body/balance"). Text = Rs ("Usermoney") & ""
XmlDoc.documentElement.selectSingleNode ("Body/posts"). Text = Rs ("postcode") & ""
XmlDoc.documentElement.selectSingleNode ("Body/userstatus"). Text = Rs ("UserLock")
XmlDoc.documentElement.selectSingleNode ("Body/homepage"). Text = Rs ("homepage") & ""
XmlDoc.documentElement.selectSingleNode ("Body/qq"). Text = Rs ("Oicq")
XmlDoc.documentElement.selectSingleNode ("Body/msn"). Text = ""
XmlDoc.documentElement.selectSingleNode ("Body/truename"). Text = Rs ("Truename") & ""
XmlDoc.documentElement.selectSingleNode ("Body/telephone"). Text = Rs ("Phone") & ""
XmlDoc.documentElement.selectSingleNode ("Body/address"). Text = Rs ("Address") & ""
Status = 0
Messenge = messenge & <li> read user data successfully. </li> "
Else
Status = 1
Messenge = messenge & <li> The user does not exist. </li> "
End If
Rs.close
Set Rs = Nothing
End Sub