XMLReader and VB.Net

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi All,
I need a few suggestions. I have the following XML segment:
<LookUp>
<ControlType>CheckBoxGroup</ControlType>
<DBField>LastMedDate</DBField>
<ControlName>cmbGoal1</ControlName>
<Values VALUE="0" BookMark="Goal1Progress"/>
<Values VALUE="1" BookMark="Goal1NoProgress"/>
<Values VALUE="2" BookMark="Goal1NA"/>
</LookUp>
I have code that will read everything except the "Values" elements. Here is
the code:
While reader.Read()
Select Case (reader.NodeType)
Case XmlNodeType.Element
If (reader.Name = "DBField") Then
ReportElement.DBField() = reader.ReadElementString()
End If
If (reader.Name = "BookMark") Then
ReportElement.BookMark = reader.ReadElementString()
End If
If (reader.Name = "ControlName") Then
ReportElement.ControlName = reader.ReadElementString()
End If
If (reader.Name = "ColumnIndex") Then
ReportElement.ColumnIndex = reader.ReadElementString()
End If
If (reader.Name = "ControlType") Then
ReportElement.ControlType = reader.ReadElementString()
End If
If (reader.Name = "Values") Then
ReportElement.AddValue (0, reader.ReadElementString())
End If
case XmlNodeType.EndElement
If (reader.Name = "LookUp") then
al.Add(ReportElement)
ReportElement.Reset()
End If
End Select
End While

I've tried a few different things to get the Values elements such as:
reader.GetAttribute("BookMark")
But it returns "Nothing" in the Command window.
Could someone please let me know how to get the values element. Thanks
Michael

.



Relevant Pages

  • Re: Getting attributes(I think) from XMLReader
    ... I have the following XML segment: ... > But it returns "Nothing" in the Command window. ... Prev by Date: ...
    (microsoft.public.dotnet.xml)
  • Getting attributes(I think) from XMLReader
    ... I have the following XML segment: ... <LookUp> ... Michael ... Prev by Date: ...
    (microsoft.public.dotnet.xml)
  • RE: last number array from string
    ... "Michael" wrote: ... > I have a address string with ID numbers at the end and want ... > as I want to use the number for a lookup, please can anyone help with a ... Prev by Date: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: adapting the findnext function
    ... > in via a lookup, is there anyway to make excel think they are just there ... > chrisrowe_cr's Profile: ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: replace characters by numbers
    ... Public Sub LettersToNumbers() ... "Michael E." ... No - for that you'd need a lookup table or an algorithm. ... correlations do you expect to see? ...
    (microsoft.public.excel.programming)