Click here to Skip to main content
15,890,043 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionEmpty value is passed while reading value from an XML node Pin
Mahesh.J29-Jun-09 19:11
Mahesh.J29-Jun-09 19:11 
AnswerRe: Empty value is passed while reading value from an XML node Pin
Stuart Dootson29-Jun-09 22:20
professionalStuart Dootson29-Jun-09 22:20 
GeneralRe: Empty value is passed while reading value from an XML node Pin
Mahesh.J29-Jun-09 23:05
Mahesh.J29-Jun-09 23:05 
GeneralRe: Empty value is passed while reading value from an XML node Pin
Stuart Dootson30-Jun-09 3:10
professionalStuart Dootson30-Jun-09 3:10 
GeneralRe: Empty value is passed while reading value from an XML node Pin
led mike30-Jun-09 4:42
led mike30-Jun-09 4:42 
GeneralRe: Empty value is passed while reading value from an XML node Pin
Stuart Dootson30-Jun-09 4:44
professionalStuart Dootson30-Jun-09 4:44 
GeneralRe: Empty value is passed while reading value from an XML node Pin
Mahesh.J30-Jun-09 19:49
Mahesh.J30-Jun-09 19:49 
QuestionForEach reading only the last node only Pin
albchinsh24-Jun-09 16:17
albchinsh24-Jun-09 16:17 
HI

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Probedata>
   <Data>
      <Key>10</Key>
      <Cmd>1</Cmd>
      <Coil1>2</Coil1>
      <Coil2>0</Coil2>
      <Program>False</Program>
      <Line>0</Line>
   </Data>
   <Data>
      <Key>20</Key>
      <Cmd>2</Cmd>
      <Coil1>4</Coil1>
      <Coil2>0</Coil2>
      <Program>False</Program>
      <Line>4</Line>
   </Data>
<Data>
      <Key>30</Key>
      <Cmd>3</Cmd>
      <Coil1>2</Coil1>
      <Coil2>5</Coil2>
      <Program>False</Program>
      <Line>1</Line>
   </Data>
</Probedata>

This is my XML file and the program part to read xml below
xmlProbe.Load(probe.xml)
Dim xmlNodeList As Xml.XmlNodeList

xmlNodeList = .xmlProbe.SelectNode("Probedata")

                        For Each j As Xml.XmlNode In xmlNodeList
                              key = CInt(xmlPNode.ChildNodes(0).InnerText)
                              prg.Cmd = CInt(xmlPNode.ChildNodes(1).InnerText)
                              prg.Coil1 = CSng(xmlPNode.ChildNodes(2).InnerText)
                              prg.Coil2 = CSng(xmlPNode.ChildNodes(3).InnerText)
                              prg.Program = CBool(xmlPNode.ChildNodes(4).InnerText)
                              prg.Lines = CInt(xmlPNode.ChildNodes(5).InnerText)
                              DictProbeCyl.Item(key) = prg
                        Next

When I run it
the For loop , loop thru' 3 time, I put it into a dictionary
But it always read the last node. e.g. for all values, the key is 30
Can anyone help?

Thanks
AnswerRe: ForEach reading only the last node only Pin
Adam Maras24-Jun-09 16:40
Adam Maras24-Jun-09 16:40 
GeneralRe: ForEach reading only the last node only Pin
albchinsh24-Jun-09 18:40
albchinsh24-Jun-09 18:40 
QuestionNested foreach loop Urgent Pin
bbm2k321-Jun-09 6:01
bbm2k321-Jun-09 6:01 
AnswerRe: Nested foreach loop Urgent Pin
Stuart Dootson21-Jun-09 14:03
professionalStuart Dootson21-Jun-09 14:03 
QuestionSkip root elements for sub classes when serializing complex object Pin
Member 183766120-Jun-09 2:23
Member 183766120-Jun-09 2:23 
AnswerRe: Skip root elements for sub classes when serializing complex object Pin
Stuart Dootson20-Jun-09 14:43
professionalStuart Dootson20-Jun-09 14:43 
Questionxml menubar Pin
paypony18-Jun-09 20:29
paypony18-Jun-09 20:29 
AnswerRe: xml menubar Pin
Stuart Dootson18-Jun-09 22:12
professionalStuart Dootson18-Jun-09 22:12 
AnswerRe: xml menubar Pin
led mike19-Jun-09 5:15
led mike19-Jun-09 5:15 
GeneralRe: xml menubar Pin
Stuart Dootson19-Jun-09 12:47
professionalStuart Dootson19-Jun-09 12:47 
QuestionUse same objects to access DB and WebService Pin
the_jat18-Jun-09 3:57
the_jat18-Jun-09 3:57 
AnswerCross Posted Pin
led mike18-Jun-09 5:19
led mike18-Jun-09 5:19 
QuestionDetect Invalid sequence of tag in XML document using schema. Pin
tprakash17-Jun-09 21:35
tprakash17-Jun-09 21:35 
AnswerRe: Detect Invalid sequence of tag in XML document using schema. Pin
Stuart Dootson18-Jun-09 0:15
professionalStuart Dootson18-Jun-09 0:15 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash18-Jun-09 18:10
tprakash18-Jun-09 18:10 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash14-Jul-09 2:18
tprakash14-Jul-09 2:18 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
Stuart Dootson14-Jul-09 2:25
professionalStuart Dootson14-Jul-09 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.