Ok I am missing something here as I am not being able to get single values from an XML file.
The file contains this:
<?xml version="1.0" encoding="utf-8" ?>
<config>
<location>Pluto</location>
<notify>0</notify>
<notifypreriod>3</notifypreriod>
</config>
I am trying to read in the three node values, location, notify and period using this code:
On the line that assigns xPath.Value to strLocation rather than just Pluto being assigned it gets PlutoNo3, then the code falls over at the line where it attempts to assign the next xPath.Value to blnNotify as it is still PlutoNo3
The messagebox is there purely for test purposes.
So am I missing somethin fundamental here
The file contains this:
<?xml version="1.0" encoding="utf-8" ?>
<config>
<location>Pluto</location>
<notify>0</notify>
<notifypreriod>3</notifypreriod>
</config>
I am trying to read in the three node values, location, notify and period using this code:
Code:
Dim xpathVersion As XPathDocument = New XPathDocument(strXMLcfg)
create a path navigator
xPath = xpathVersion.CreateNavigator
move to the first child node in the file I presume it to be location
xPath.MoveToFirstChild()
get the location of this running apps data source
strLocation = xPath.Value
xPath.MoveToNext()
blnNotify = xPath.Value
xPath.MoveToNext()
intPeriod = xPath.Value
MessageBox.Show(strLocation & ControlChars.CrLf & blnNotify & ControlChars.CrLf & intPeriod)
On the line that assigns xPath.Value to strLocation rather than just Pluto being assigned it gets PlutoNo3, then the code falls over at the line where it attempts to assign the next xPath.Value to blnNotify as it is still PlutoNo3
The messagebox is there purely for test purposes.
So am I missing somethin fundamental here