smileyc 0 Newbie Poster

Hi. using the following code I am trying to read an xml stream

[code=vb.net]
 Do While (reader.Read())
            Select Case reader.NodeType

                Case XmlNodeType.Element 'Display beginning of element.

                    MsgBox("<" + reader.Name)

                Case XmlNodeType.Text 'Display the text in each element.
                    MsgBox(reader.Value)
                Case XmlNodeType.EndElement 'Display end of element.
                    MsgBox("</" + reader.Name + ">")
                    ' MsgBox(">")
                Case XmlNodeType.Attribute
                    MsgBox(reader.Value)
                Case XmlNodeType.EntityReference
                    MsgBox(reader.Value)
                Case XmlNodeType.EndElement
                    MsgBox("At end element" + reader.Value)
                Case XmlNodeType.Comment
                    MsgBox(reader.Value)
                Case XmlNodeType.SignificantWhitespace
                    MsgBox("SignificantWhitespace")
                Case XmlNodeType.Whitespace
                    MsgBox("Whitespace")
                Case XmlNodeType.ProcessingInstruction
                    MsgBox(reader.Value)
            End Select
        Loop
[/ code]

If the element is wholly between the tags such as

<book>MOBY DICK</book>

Then the msgbox displays the title of the book.
If as in the case below there is a whitespace in the element name t

<book title ="MOBY DICK" value="Not Available"/>

Then the code simpley selects the 'whitespace' case and does not go on to parse the rest of the element line.

So my question is, using vb.net how can I read the elements and associated values in such an xml schema? I best state that all this is v new to me, so if I have used any inccorrect terms in describing my problem I apologise and hope that such does render the description of my problem unintelligible. THanks for all and any help.