【发布时间】:2015-03-25 00:41:06
【问题描述】:
我有一个 VB.net 函数,它为 xml 文档中的每个“属性”发送 HTTP POST 请求。然而,它只循环通过第一个属性节点,但无论多少次都有节点。即如果有 5 个属性节点,它会循环通过第一个节点 5 次。
我不明白为什么它不能通过所有属性节点继续。
vb.net 代码。
For Each PropertyNode As XmlNode In Props.SelectNodes("properties/property")
Try
'The Function'
End Try
Next
正在读取这个 xml 文档(道具)。
<?xml version="1.0" encoding="utf-8"?>
<properties>
<property networkid="" salesbranchid="" lettingsbranchid="" markettype="s" marketingref="-" uripath="" id="5187" created="2015-02-26T09:55:00" edited="2015-03-24T14:55:00" rmstatus="u" reference="RM66998" title="Pea Lane, Caerphilly" classification="Residential" type="7" category="Apartment" status="Available" tenure="Freehold" addressname="75" address1="Pea Lane" area="Caerphilly" city="Caerphilly" county="Glamorgan" postcode1="CF48 " postcode2="5PP" bedrooms="2" receptions="1" bathrooms="2" squarefoot="0.00" price="155446.0000" pricetype="3">
<office id="2" name="Cathays Terrace" address1="85 Cathays Terrace" city="Cardiff" postcode="CF24 4HT" telephone="029 2022 7080" />
</property>
<property networkid="" salesbranchid="" lettingsbranchid="" markettype="l" marketingref="NEWPROP17-L" uripath="" id="5180" created="2015-02-03T16:21:00" edited="2015-03-24T15:01:00" rmstatus="u" reference="NEWPROP17" title="Kings Heath, Roath" summary="A lettings summary" description="A lettings description" classification="Residential" type="7" category="Apartment" status="Available" tenure="12 Months" addressname="44 Only Way" address1="Kings Heath" area="Roath" city="Cardiff" county="Glamorgan" postcode1="CF24 " postcode2="3QD" bedrooms="3" receptions="1" bathrooms="2" squarefoot="0.00" price="500.0000">
</property>
<meta totalitems="2" maxpictures="0" maxfloorplans="0">
<account networkid="" salesbranchid="" lettingsbranchid="" />
</meta>
</properties>
【问题讨论】: