Skip to content

Commit

Permalink
Fix for a bug in generating WHDLoad attributes (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-j-green authored Dec 29, 2024
1 parent b942648 commit ca4e9a2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions gaseous-signature-parser/classes/parsers/WHDLoadParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,19 @@ public RomSignatureObject Parse(string XMLFile)
}
}

if (romNode.HasChildNodes)
// process attribute elements
foreach (XmlNode childNode in romNode.ChildNodes)
{
Dictionary<string, object> romAttributes = new Dictionary<string, object>();
foreach (XmlNode romChildNode in romNode.ChildNodes)
string childNodeName = $"whdload.{nodeName}";
if (childNode.GetType() == typeof(XmlElement))
{
romAttributes.Add(romChildNode.Name, romChildNode.InnerText);
childNodeName = $"{childNodeName}.{childNode.Name}";
rom.Attributes.Add(childNodeName, childNode.InnerText);
}
else
{
rom.Attributes.Add(childNodeName, childNode.InnerText);
}
rom.Attributes.Add(nodeName, romAttributes);
}
else
{
rom.Attributes.Add(nodeName, romNode.InnerText);
}
}

Expand Down

0 comments on commit ca4e9a2

Please sign in to comment.