Re: Getting attributes(I think) from XMLReader

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



Thanks for the quick reply. I have another question for you. Do the elements
in the Lookup section always have to be the same. The reason I asked, is that
I originally had a Lookup section that did not have the Values elements at
the start of the file, and when it got to the loopup that had the Values
elements it never showed the Values element. I setup a file with 2 Lockups in
it with all the elements and it sees the Values element (but not with the
Attribute Type). It sees it as a regular Element type, but I can't get at the
data.
I tried your suggestiont, but it never gets to the Attributes section. I
added the following case to the original case statment:
case xmlnodetype.Attribute
If (reader.Name = "Values") Then
ReportElement.AddValue (0, reader.ReadElementString())
End If
I can use Altova XMLSpy and can see all the elements including the Values
elements. Have any suggestions. Thanks
Michael




"Alex Passos" wrote:

> I think those nodes would be of type attribute. Put in a case statement to
> handle this type in your code.
>
> "Michael" <Michael@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:8C9F3701-3DE1-4856-A778-5AF88513AB30@xxxxxxxxxxxxxxxx
> > 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: 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)
  • Re: User information -> display name lookup field
    ... thank bob, thats what i thought, and the lookup works on the portal home ... > Bob Mixon ... >> We are trying to use the lookup field in portal to list users names to ...
    (microsoft.public.sharepoint.portalserver)
  • Getting attributes(I think) from XMLReader
    ... I have the following XML segment: ... <LookUp> ... Michael ... Prev by Date: ...
    (microsoft.public.dotnet.xml)
  • XMLReader and VB.Net
    ... I have the following XML segment: ... <LookUp> ... Michael ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: formula ignores last infor - please help
    ... You can make most of your other "lookup" formulas more efficient, ... trouble with barcodes in TEXT and NUMBERS. ... with just a quick look-over I can see no reason for having the mixed ... > Sonar:confused: ...
    (microsoft.public.excel.worksheet.functions)