<%
'设置输出的字符编码
Response.charset = "gb2312"
'获取省份
id = request.QueryString("id")
if id = "layer0" then
province = "湖南"
elseif id = "layer1" then
province = "广东"
elseif id = "layer2" then
province = "广西"
end if
'加载XML解析器
Set objXML = Server.CreateObject("Msxml2.DOMDocument")
'加载XML文件
xmlDoc = objXML.load(Server.MapPath("sample15.xml"))
'获得省份节点
Set provinceNode = objXML.getElementsByTagName(province)
'获得省份节点下的所有市节点
set cityNodes = provinceNode(0).getElementsByTagName("市")
'设置输出的文字
returnStr = ""
For i = 0 To cityNodes.length-1
returnStr = returnStr & cityNodes(i).text & ","
Next
'输出文字
Response.Write returnStr
set cityNodes = Nothing
set provinceNode = Nothing
set xmlDoc = Nothing
set objXML = Nothing
%>