0
Reply

Xml not read properly

shahed hussain

shahed hussain

Jun 3 2011 11:06 AM
1.9k
Hi all.

I have a strange problem with vb.net (vs 2008 - win xp).

I have to read a XML file and then put results to a list view.

The first file looks like this:

[code]
<results status='passed'><is-available>true</is-available><snapmirror-status><snapmirror-status-info><source-location>10.10.1.51:C_Drives</source-location><destination-location>netapp2a:C_Drives_Mirror</destination-location><last-transfer-from>10.10.1.51:C_Drives</last-transfer-from><last-transfer-type>scheduled</last-transfer-type><last-transfer-size>4977452</last-transfer-size><last-transfer-duration>105</last-transfer-duration><transfer-progress>0</transfer-progress><lag-time>81553</lag-time><mirror-timestamp>1307030401</mirror-timestamp><contents>Replica</contents><status>idle</status><state>snapmirrored</state><base-snapshot>netapp2a(0135106693)_C_Drives_Mirror.24</base-snapshot></snapmirror-status-info></snapmirror-status></results>
[/code]

I can read this without problem, everything works.

If I try to read this file:

[code]
<results status="passed"><are-vols-onlining>false</are-vols-onlining><luns><lun-info><path>/vol/CitrixLicense_Mirror/LunCitrixLicense</path><size>17093885952</size><online>true</online><mapped>false</mapped><read-only>true</read-only><staging>false</staging><share-state>none</share-state><multiprotocol-type>xen</multiprotocol-type><uuid>899954de-7d40-11e0-a1b4-00a09826cf00</uuid><serial-number>P4DOkocjlRtq</serial-number><block-size>512</block-size><is-space-reservation-enabled>true</is-space-reservation-enabled><size-used>955940864</size-used></lun-info></luns></results>
[/code]

Something goes wrong...

Simply it doesn't read each line...

I use the same code on both files, but when I read the second file, in debug mode, I can see that the first 2 lines are ok, then the reader.value has a value of "NONE". After this, it goes until the "multi protocol" and it goes until end.

So... WHY some lines are not read?

As attachment you can find my code (working = codeOK        not working = BADcode).

Thanks

Attachment: mycode.rar