我有類似下面的XML文件:解析XML數據XPath中
<Adresses>
<Address1>
<XPath>//Address/Local[001]/AddressLine1</XPath>
<Key>1</Key>
</Address1>
<Address2>
<XPath>//Address/Local[002]/AddressLine1</XPath>
<Key>2</Key>
</Address2>
<Address3>
<XPath>//Address/Local[003]/AddressLine1</XPath>
<Key>3</Key>
</Address3>
<Address4>
<XPath>//Address/Local[004]/AddressLine1</XPath>
<Key>4</Key>
</Address4>
<Address5>
<XPath>//Address/Local[005]/AddressLine1</XPath>
<Key>5</Key>
</Address5>
</Adresses>
我想使用XPath在C#來解析的XML值。在這種情況下,我想用元素<XPath>
上的本地[001]替換本地[002],本地[003],本地[004]和本地[005]。
你試圖完成什麼*部分是造成困難? –
你想用什麼替換它們? – Reddog
我想用Local [001]替換Local [002],Local [003],Local [004]和Local [005]。在發佈XML時也犯了一個錯誤。在Local [00X]部分之後,它應該分別是/ AddressLine1,/ AddressLine2,/ AddressLine3,/ AddressLine4和/ AddressLine5,它們將保持相同。 @Reddog – ncoder