-1
父母下參數我有孩子參數爲「Fruit」和「TransactionID」。我想讀取「Fruit」和「TransactionID」的值。從cml的xml中從父節點讀取子節點
XML代碼:
<soap:Parameters>
<soap:Parameter>
<soap:Name>Fruit</soap:Name>
<soap:Value>Apple</soap:Value>
</soap:Parameter>
<soap:Parameter>
<soap:Name>TransactionID</soap:Name>
<soap:Value>1111111</soap:Value>
</soap:Parameter>
</soap:Parameters>
熟悉該[的XDocument類(https://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument(V = vs.110)的.aspx) – tinstaafl
甲首先使用XDocument Class解析XML文件,然後使用Linq查詢遍歷父節點 –
使用LINQ to XML – A3006