所以我得到了這個XML。 我在XML中有很多類似的塊,我可以通過它循環。但是,我怎麼知道有多少塊? 或者我會如何停止後最後一個塊?到達最後一個XML元素
任何建議表示讚賞。
<StockBalanceOut xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/BON_StockBalanceOut" class="entity">
<_DocumentHash>f5a598f180ccdecffeb7774d58ca8743</_DocumentHash>
<AvailPhysicalAvailableQty>0</AvailPhysicalAvailableQty>
<AvailPhysicalReservedQty>0</AvailPhysicalReservedQty>
<AvailPhysicalReturnQty>0</AvailPhysicalReturnQty>
<AvailPhysicalReworkQty>0</AvailPhysicalReworkQty>
<AvailPhysicalScrapQty>0</AvailPhysicalScrapQty>
<Date>2014-09-26</Date>
<ItemId>15742-20907</ItemId>
<ItemShippingClass>Empty</ItemShippingClass>
<OnOrderQty>0</OnOrderQty>
<PhysicalInventAvailableQty>0</PhysicalInventAvailableQty>
<PhysicalInventReservedQty>0</PhysicalInventReservedQty>
<PhysicalInventReturnQty>0</PhysicalInventReturnQty>
<PhysicalInventReworkQty>0</PhysicalInventReworkQty>
<PhysicalInventScrapQty>0</PhysicalInventScrapQty>
<RecId>5637416600</RecId>
<RecVersion>1</RecVersion>
<Time>15:25:52</Time>
</StockBalanceOut>
<StockBalanceOut xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/BON_StockBalanceOut" class="entity">
<_DocumentHash>6c6a3aa160f3ab9388f8e1b5b2fd7dc1</_DocumentHash>
<AvailPhysicalAvailableQty>99</AvailPhysicalAvailableQty>
<AvailPhysicalReservedQty>0</AvailPhysicalReservedQty>
<AvailPhysicalReturnQty>0</AvailPhysicalReturnQty>
<AvailPhysicalReworkQty>0</AvailPhysicalReworkQty>
<AvailPhysicalScrapQty>0</AvailPhysicalScrapQty>
<Date>2014-09-26</Date>
<ItemId>21234-29752</ItemId>
<ItemShippingClass>Empty</ItemShippingClass>
<OnOrderQty>0</OnOrderQty>
<PhysicalInventAvailableQty>99</PhysicalInventAvailableQty>
<PhysicalInventReservedQty>0</PhysicalInventReservedQty>
<PhysicalInventReturnQty>0</PhysicalInventReturnQty>
<PhysicalInventReworkQty>0</PhysicalInventReworkQty>
<PhysicalInventScrapQty>0</PhysicalInventScrapQty>
<RecId>5637416601</RecId>
<RecVersion>1</RecVersion>
<Time>15:25:52</Time>
</StockBalanceOut>
請顯示您的當前代碼「循環」 – Steve 2014-09-29 19:44:29
當您說「blocks」時,您的意思是什麼? XML標籤? – 2014-09-29 19:44:49
@Steve 我甚至無法啓動,因爲我不知道最終參數。 – user3369276 2014-09-29 19:47:15