Skip to content

Commit

Permalink
Fixed bug in the PlusParser classes, where records were being skipped…
Browse files Browse the repository at this point in the history
… if they were not separated by newlines or whitespaces.
  • Loading branch information
jaerith committed Jun 9, 2021
1 parent c750359 commit fc87b64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions OnixData/OnixLegacyPlusParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public bool MoveNext()
if (this.OnixHeader == null)
this.OnixHeader = OnixParser.MessageHeader;

while (this.OnixReader.Read())
do
{
if ((this.OnixReader.NodeType == XmlNodeType.Element) && (this.OnixReader.Name == this.ProductXmlTag))
{
Expand All @@ -228,7 +228,8 @@ public bool MoveNext()
sProductBody = this.OnixReader.ReadOuterXml();
break;
}
}

} while (this.OnixReader.Read());

if (!String.IsNullOrEmpty(sProductBody))
{
Expand Down
5 changes: 3 additions & 2 deletions OnixData/OnixPlusParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public bool MoveNext()
bool bResult = false;
string sProductBody = null;

while (this.OnixReader.Read())
do
{
if ((this.OnixReader.NodeType == XmlNodeType.Element) && (this.OnixReader.Name == this.ProductXmlTag))
{
Expand All @@ -215,7 +215,8 @@ public bool MoveNext()
sProductBody = this.OnixReader.ReadOuterXml();
break;
}
}

} while (this.OnixReader.Read());

if (!String.IsNullOrEmpty(sProductBody))
{
Expand Down

0 comments on commit fc87b64

Please sign in to comment.