I'm trying to parser a wrong XML code with XmlStringReader, like this one.
<Page CODE=""L"" page Caption=""Example""><Cell CellType="0"...></Cell></Page>
and with this code, I try to get the value from the cell type attribute in the Cell Tag.
Using reader As XmlReader = XmlTextReader.Create(New StringReader(l.Label), New XmlReaderSettings With {
.ValidationType = ValidationType.None,
.XmlResolver = Nothing})
While (reader.ReadToFollowing("Cell"))
reader.MoveToAttribute("CellType")
Select Case Int32.Parse(reader.Value)
...
End Select
End While
So I get the following XmlException
'Caption' is an unexpected token. The expected token is '='
Are there any ways to avoid this exception? or Should I parse the xml before this to fix the attribute wrong written?
Thanks