2015-02-06 85 views
0

以下是我从Web服务得到的结果,如何更改记录名称以便唯一标识它?例如Record1Record2Record3Web服务列表记录

This XML file does not appear to have any style information associated with it. The document tree is shown below. 
<ArrayOfRecord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"> 
<Record> /*How to change this Record to Record1*/ 
<item> 
Buffalo DriveStation Combo 3.5 inch External Hard Drive USB 2.0 1.5TB Quadra 
</item> 
<qty>1</qty> 
<qtyapproved>1</qtyapproved> 
<availability>0</availability> 
<description>Returned</description> 
<itemdescription>-</itemdescription> 
<id>188</id> 
</Record> 
<Record> 
<item>eSataII HDD Docking with 1TB 3.5 inch hard disk</item> 
<qty>1</qty> 
<qtyapproved>1</qtyapproved> 
<availability>0</availability> 
<description>Returned</description> 
<itemdescription/> 
<id>184</id> 
</Record> 
</ArrayOfRecord> 

回答

0

而不是更改记录名称包含Web服务返回的结果集中的唯一列,如果您没有任何唯一列,则可以使用序列号。

例如,你可以在记录

<Record> /*How to change this Record to Record1*/ 
<itemId>1</itemId> 
<item> 
Buffalo DriveStation Combo 3.5 inch External Hard Drive USB 2.0 1.5TB Quadra 
</item> 
<qty>1</qty> 
<qtyapproved>1</qtyapproved> 
<availability>0</availability> 
<description>Returned</description> 
<itemdescription>-</itemdescription> 
<id>188</id> 
</Record> 
添加的itemId新列