Hi
I'm pretty new at this so please don't laugh too hard. I'm trying to load
an xml document using VB.NET and having a hard time. My code doesn't crash
but it doesn't work either, the first msgbox returns 0.
Help (please!)
Below is my document and snippet of code
<?xml version="1.0" encoding="utf-8"?>
<CAREKEEPER xmlns="http://tempuri.org/config1.xsd">
<TABLEINFORMATI ON TABLE="workers" ssn="ssn" emplid="userinp ut1">
</TABLEINFORMATIO N>
<SERVERS hostname="sta0w p02" database="vivid care">
</SERVERS>
<SERVERS hostname="rdy1c n02" database="vivid care">
</SERVERS>
</CAREKEEPER>
CODE:
Try
xml_doc.Load(". ./config.xml")
xml_nodelist = xml_doc.SelectN odes("/carekeeper")
MsgBox(xml_node list.Count())
For Each xml_node In xml_nodelist
server = xml_node.Item(" SERVER").InnerT ext()
MsgBox(server)
Next
Catch ex As Exception
MsgBox("XMLPARS ER: CONFIGURATION FILE ERROR " & ex.Message & " "
& ex.Source)
End Try
I'm pretty new at this so please don't laugh too hard. I'm trying to load
an xml document using VB.NET and having a hard time. My code doesn't crash
but it doesn't work either, the first msgbox returns 0.
Help (please!)
Below is my document and snippet of code
<?xml version="1.0" encoding="utf-8"?>
<CAREKEEPER xmlns="http://tempuri.org/config1.xsd">
<TABLEINFORMATI ON TABLE="workers" ssn="ssn" emplid="userinp ut1">
</TABLEINFORMATIO N>
<SERVERS hostname="sta0w p02" database="vivid care">
</SERVERS>
<SERVERS hostname="rdy1c n02" database="vivid care">
</SERVERS>
</CAREKEEPER>
CODE:
Try
xml_doc.Load(". ./config.xml")
xml_nodelist = xml_doc.SelectN odes("/carekeeper")
MsgBox(xml_node list.Count())
For Each xml_node In xml_nodelist
server = xml_node.Item(" SERVER").InnerT ext()
MsgBox(server)
Next
Catch ex As Exception
MsgBox("XMLPARS ER: CONFIGURATION FILE ERROR " & ex.Message & " "
& ex.Source)
End Try
Comment