I have the following xml in a file (simplified):
<?xml version="1.0" encoding="ISO-8859-1"?>
<XCer xmlns="http://x.y.z" xmlns:xsi="http://www.x.y.z" xsi:schemaLocation="http://www.x.y.z" track_id="559" mp_id="398" sub_id="569">
<capability xsi:type="XCracT">
<type>rec</type>
<sub_type>pc</sub_type>
<action>reco</action>
</capability>
<final_result OD="DGS=1.6" creator="Creator1" version="1.11" xsi:type="XCarT">
<code>300000000</code>
<code_cnf>0.7454</code_cnf>
<code_attr>seq</code_attr>
<status_attr>fdos</status_attr>
<text>this text</text>
<standardized_text>other text</standardized_text>
<region>
<type>add</type>
<symbology>machine</symbology>
</region>
</final_result>
<final_result OD="DGS=1.7" creator="Creator2" version="1.11" xsi:type="XCarT">
<code>3040280100015</code>
<code_cnf>0.7454</code_cnf>
<code_attr>seq</code_attr>
<status_attr>fdos</status_attr>
<text>this text</text>
<standardized_text>other text</standardized_text>
<region>
<type>add</type>
<symbology>machine</symbology>
</region>
<polygon>
<dot x="849" y="1600"/>
<dot x="823" y="1600"/>
<dot x="819" y="1166"/>
<dot x="845" y="1166"/>
</polygon>
</final_result>
</XCer>
On a very basic level I want to create 3 variables: creator, code, mp_id and fill them with the details from the final result OD="DGS=1.6" section i.e. 'Creator1', '300000000', '398' (from the first XCer element) and 'this text' but my xml skills are soreley lacking despite trying several crash courses in the last couple of days.
I have tried the basic
Using reader As XmlReader = XmlReader.Create("C:\filename.xml")
while reader.Read()
if reader.IsStartElement() Then
If reader.Name = "code" Then
code = reader.ReadElementContentAsString()
which gets me the code but I cannot get any of the elements within the line
final_result OD="DGS=1.6" creator="Creator1" version="1.11" xsi:type="XCarT">
and I cannot limit the code element which I want to that subtree without over writing the previous code.