1
我使用下面的代碼查詢大(1000個節點)的XML文件的XML文件:
$.ajax({
type: "GET",
cache: false,
url: "someFile.xml",
dataType: "xml",
contentType: "text/xml",
success: function(xmlHttpRequest)
及以下XML結構:
<hospitals>
<hospital>
<id>1</id>
<name>H1</name>
<city>Riyadh</city>
<tel>1234567</tel>
<coordinates>27.034052,49.490662</coordinates>
</hospital>
</hospitals>
我的問題是:是否有一種方法可以在不讀取整個文件的情況下過濾(基於城市)XML文件,然後自行過濾?我很確定在上面的調用中有一個字段進行過濾,但我無法弄清楚。