Answer the question
In order to leave comments, you need to log in
XmlReader skips tags, how to overcome?
https://docs.microsoft.com/ru-ru/dotnet/api/system...
An extremely interesting situation. XmlReader skips tags and every other time.
while (_reader.Read())
{
switch (_reader.NodeType)
{
case XmlNodeType.Element:
if (_reader.Name == Tags.CompanyTag)
{
var c = new Company(_reader.ReadOuterXml());
PutInDictionary(c);
OnCompanyParsed(this, c);
}
break;
}
}
<?xml version="1.0" encoding="utf-8" ?>
<companies_list>
<company>
<name>A</name>
</company>
<company>
<name>B</name>
</company>
<company>
<name>C</name>
</company>
</companies_list>
<?xml version="1.0" encoding="utf-8" ?>
<companies_list><company><name>A</name></company><company><name>B</name></company><company><name>C</name></company></companies_list>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question