如何判断XML标签中的指定属性是否存在?内详:

例如:

 1<aa abc="">   
 2  
 3如何判断 aa 中是否存在 abc 这个属性?   
 4我使用遍历的方法可以实现,请问还有没有更高效的方法?   
 5\---------------------------------------------------------------   
 6  
 7set aa=xmldom.selectSingleNode("//aa/@abc")   
 8If Not (aa Is Nothing) Then   
 9......   
10set aa=xmldom.selectSingleNode("//aa")   
11if Not aa Is Nothing Then   
12\---------------------------------------------------------------   
13  
14var aa=xmldom.selectSingleNode("//aa/@abc")   
15if(aa!=null)   
16  
17aa=xmldom.selectSingleNode("//aa")   
18if(aa!=null)   
19alert("可用")</aa>
Published At
Categories with Web编程
comments powered by Disqus