kenhepworth
13 years agoOccasional Contributor
NewDataSet XML files
Hi,
I am currently attempting to try and retrieve the data from a NewDataSet XML file, and I am having problems getting the results I want. Whenever I want to get the record and the nodename, I always get #text for the nodename. A sample of the XML file, the code that I am using and the result I am getting are below. I want the result that I am getting for the value to look like "Cfgtype : ADMEM", but I keep on getting this #text
I haven't had any problems with other types of XML files, it is just this NewDataSet one is giving me strife.
Any suggestiones would be great.
Regards,
Ken
<NewDataSet>
<PESConfig>
<Cfgtype>ADMEM</Cfgtype>
<Cfgakey1 />
<Cfgakey2 />
<Cfgikey1>0</Cfgikey1>
<Cfgikey2>0</Cfgikey2>
<Cfgstr1 />
<Cfgstr2 />
<Cfgint1>0</Cfgint1>
<Cfgint2>0</Cfgint2>
<Cfgfloat1>0</Cfgfloat1>
<Cfgfloat2>0</Cfgfloat2>
</PESConfig>
<PESConfig>
<Cfgtype>AGR</Cfgtype>
<Cfgakey1 />
<Cfgakey2 />
<Cfgikey1>0</Cfgikey1>
<Cfgikey2>0</Cfgikey2>
<Cfgstr1 />
<Cfgstr2 />
<Cfgint1>0</Cfgint1>
<Cfgint2>0</Cfgint2>
<Cfgfloat1>0</Cfgfloat1>
<Cfgfloat2>0</Cfgfloat2>
</PESConfig>
<PESConfig>
<Cfgtype>ALZLU</Cfgtype>
<Cfgakey1 />
<Cfgakey2 />
<Cfgikey1>0</Cfgikey1>
<Cfgikey2>0</Cfgikey2>
<Cfgdate1>2002-06-20T17:39:06+10:00</Cfgdate1>
</PESConfig>
</NewDataSet>
The code that I am attempting to use is
I am currently attempting to try and retrieve the data from a NewDataSet XML file, and I am having problems getting the results I want. Whenever I want to get the record and the nodename, I always get #text for the nodename. A sample of the XML file, the code that I am using and the result I am getting are below. I want the result that I am getting for the value to look like "Cfgtype : ADMEM", but I keep on getting this #text
I haven't had any problems with other types of XML files, it is just this NewDataSet one is giving me strife.
Any suggestiones would be great.
Regards,
Ken
<NewDataSet>
<PESConfig>
<Cfgtype>ADMEM</Cfgtype>
<Cfgakey1 />
<Cfgakey2 />
<Cfgikey1>0</Cfgikey1>
<Cfgikey2>0</Cfgikey2>
<Cfgstr1 />
<Cfgstr2 />
<Cfgint1>0</Cfgint1>
<Cfgint2>0</Cfgint2>
<Cfgfloat1>0</Cfgfloat1>
<Cfgfloat2>0</Cfgfloat2>
</PESConfig>
<PESConfig>
<Cfgtype>AGR</Cfgtype>
<Cfgakey1 />
<Cfgakey2 />
<Cfgikey1>0</Cfgikey1>
<Cfgikey2>0</Cfgikey2>
<Cfgstr1 />
<Cfgstr2 />
<Cfgint1>0</Cfgint1>
<Cfgint2>0</Cfgint2>
<Cfgfloat1>0</Cfgfloat1>
<Cfgfloat2>0</Cfgfloat2>
</PESConfig>
<PESConfig>
<Cfgtype>ALZLU</Cfgtype>
<Cfgakey1 />
<Cfgakey2 />
<Cfgikey1>0</Cfgikey1>
<Cfgikey2>0</Cfgikey2>
<Cfgdate1>2002-06-20T17:39:06+10:00</Cfgdate1>
</PESConfig>
</NewDataSet>
The code that I am attempting to use is
FID = Log.CreateFolder(ANode.nodeName)
' If the node value is not null, output it
If aqObject.GetVarType(ANode.nodeValue) <> 1 Then
Log.Message ANode.nodename + " : " + ANode.nodeValue
End If
And it gives me a result like this
NewDataSet
PESConfig
Cfgtype
#text
#text : ADMEM
Cfgakey1
Cfgakey2
Cfgikey1
#text l
#text : 0
Cfgikey2
#text
#text : 0
Cfgstr1
Cfgstr2
Cfgint1
#text
#text : 0
Cfgint2
#text
#text : 0
Cfgfloat1
#text
#text : 0
Cfgfloat2