XML Exception occurred when reading xml

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi, I tried to read the fallowing xml structure:


<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; View1Speed<span style="color:Blue; >

0

<span style="color:Blue; <<span style="color:#A31515; Color<span style="color:Blue; >Green<span style="color:Blue; </<span style="color:#A31515; Color<span style="color:Blue; >

<span style="color:Blue; </<span style="color:#A31515; View1Speed<span style="color:Blue; >
[/code]


But an XMLException occurred, saying:

Element is an invalid XmlNodeType.

My code:

<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; if (textReader.NodeType == XmlNodeType.Element && textReader.Name == <span style="color:#A31515; "View1Speed")

{
user.setView1Speed(textReader.ReadElementContentAsInt());
}
[/code]


My aim is to get the content of View1Speed, that is to say, number 0.

Greetings

View the full article
 
Back
Top