我有一個這樣的XML文件模板來自一些IC芯片,我希望能夠將每個Pins Test類型數據存儲爲一個數組,以便稍後我可以在笛卡爾圖上繪製它。可以嵌套XPath迭代嗎?
的數據結構是這樣的: <NUMBER></NUMBER>
是IC的特定引腳的名稱 <Curve Count="">
被的完成到管腳測試數 <Type></Type>
是測試
的類型和存在一些電壓值和電流值那我必須放入一個數組,以便以後使用它。
無論如何!我的問題是如何獲得這些值?我不要求直接回答(但它是appriciated),但一些指導,讓我找到線程真的appriciated。
編輯:如果somone親切地給我一個代碼,從A1有3個電壓和3個電流值,我可以很容易地得到這個想法,並繼續自己。
此XML看起來喜歡這樣的:
<?xml version="1.0" encoding="utf-8"?>
<Document>
<Device>NEC555</Device>
<Pins Count="3">
<Pin>
<Number>A1</Number>
<Curves Count ="3">
<Curve>
<Type>PreStress</Type>
<VIPairs Count="3">
<VIPair>
<Voltage>-2</Voltage>
<Current>-0.003</Current>
</VIPair>
<VIPair>
<Voltage>-1</Voltage>
<Current>-0.002</Current>
</VIPair>
<VIPair>
<Voltage>-0</Voltage>
<Current>-0.001</Current>
</VIPair>
</VIPairs>
</Curve>
<Curve>
<Type>PreFail</Type>
<VIPairs Count="3">
<VIPair>
<Voltage>-2</Voltage>
<Current>-0.003</Current>
</VIPair>
<VIPair>
<Voltage>-1</Voltage>
<Current>-0.002</Current>
</VIPair>
<VIPair>
<Voltage>-0</Voltage>
<Current>-0.001</Current>
</VIPair>
</VIPairs>
</Curve>
<Curve>
<Type>PostFail</Type>
<VIPairs Count="0">
</VIPairs>
</Curve>
</Curves>
</Pin>
<Pin>
<Number>B1</Number>
<Curves Count ="3">
<Curve>
<Type>PreStress</Type>
<VIPairs Count="3">
<VIPair>
<Voltage>-3</Voltage>
<Current>-0.005</Current>
</VIPair>
<VIPair>
<Voltage>-1</Voltage>
<Current>-0.002</Current>
</VIPair>
<VIPair>
<Voltage>-0</Voltage>
<Current>-0.001</Current>
</VIPair>
</VIPairs>
</Curve>
<Curve>
<Type>PreFail</Type>
<VIPairs Count="3">
<VIPair>
<Voltage>-3</Voltage>
<Current>-0.003</Current>
</VIPair>
<VIPair>
<Voltage>-1</Voltage>
<Current>-0.002</Current>
</VIPair>
<VIPair>
<Voltage>-0</Voltage>
<Current>-0.001</Current>
</VIPair>
</VIPairs>
</Curve>
<Curve>
<Type>PostFail</Type>
<VIPairs Count="0">
</VIPairs>
</Curve>
</Curves>
</Pin>
</Pins>
</Document>
因爲XPath 1.0節點集是唯一的無序節點集,所以沒有辦法表達一個像你想要分組的分層結構。 – 2011-03-14 16:14:08