I was making a Silverlight 3 application in Visual Studio 2008. The code was suppose to open a Stream object and read it using an XmlReader. The code compiled and ran but for some reason it seemed like only some of the XML nodes were being read. After spending two hours tracking to fix this problem I stunned to learn what the issue was. The Silverlight XmlReader does not reliably read XML nodes if they are on the same line. To reliably read the XML nodes, the XML has to be formatted so that child nodes are on a new line. For example, was not being reliably read. Sometimes the reader would only read one child element. However, if you format the XML like the following then the XmlReader would work reliably.
The Silverlight code I was using to read the XML was the following.
Dim stream As New StringReader(data)
Dim reader As XmlReader = XmlReader.Create(stream)
If reader.NodeType = XmlNodeType.Element Then
If reader.Name = “Stroke” Then