<? XML version = "1.0" encoding = "gb2312"?>
<Materialclasses>
<Materialclass materialclasscode = "01" Description = "what is the crime of illegally absorbing public deposits? How to punish? "/>
</Materialclasses>
XML file above
1. Use Javascript
VaR xmldoc = new activexobject ("msxml2.domdocument ");
Xmldoc. async = false;
Xmldoc. Load ("AA. xml ");
VaR attnode = xmldoc. selectsinglenode ("// materialclasses/materialclass [@ materialclasscode = '" + ID + "']/@ description"). text;
Document. getelementbyid ("Question"). innerhtml = attnode;
2. Use ASP
<%
Var = request. querystring ("ID ")
Set xml = server. Createobject ("Microsoft. xmldom ")
XML. async = false
XML. Load server. mappath ("AA. xml ")
Set node = xml. selectsinglenode ("// materialclass [@ materialclasscode = '" & var & "']")
Response. Write node. getattribute ("Description ")
%>
The preceding two methods are used to obtain the value of the description attribute on the contact.