次の形式の XML があります。
<Accounts>
<Account ID="1" City="Bangalore" Amount="2827561.95" />
<Account ID="225" City="New York" Amount="12312.00" />
<Account ID="236" City="London" Amount="457656.00" />
<Account ID="225" City="London" Amount="23462.40" />
<Account ID="236" City="Bangalore" Amount="2345345.00" />
</Accounts>
ここで、アカウントを一意にしているのは、属性ID
との組み合わせですCity
。
Amount
独特の読み方は?ID
とCity
属性の組み合わせの金額を読み取るにはどうすればよいですか?
たとえば、 と をAmount
使用してアカウントの を取得する必要がID=225
ありCity=London
ます。次のようなコードを使用する場合
Node.GetAttribute('ID')=225
ID=225 の最初のノードが常に表示されます
ありがとうございます。