这样试一下`~~
<?xml version="1.0" standalone="yes"?>
<DocumentElement>
<car id="001" name="宝马">
<X id="001" name="长">30.250143333333334</X>
<Y>120.18001166666667</Y>
</car>
</DocumentElement>
<script language="javascript">
var xmlDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("xml.xml");
var a ,X
a=xmlDoc.selectSingleNode("//DocumentElement//car[//@id='001']//@name").text;
X=xmlDoc.selectSingleNode("//DocumentElement//car[//@id='001']//X[//id='001']//@name").text;
window.alert(a);
</script>
[此贴子已经被作者于2007-8-24 17:41:13编辑过]