Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As mentioned in #9 the data from tables isn't always parsed correctly. As I was already checking the nmap DTD XML specifications, I saw that the relation between scripts, tables and elements is a bit more complicated.
While your approach - using a map for one table - was quiet comfortable it lacked completeness.
Here's an excerpt of the relevant section in the DTD:
The major problems are:
- nested tables
- elements without key
- (tables without key)
Because of the optional keys I decided to create new structs for
Tables
andElements
in my approach. I also considered adding an additional map to each one of the new structs, that would allow for a more comfortable access. But in the end I decide against that, as the missing keys would still be a problem.Currently the
script
does not have a field for thePCDATA
. This was not of relevance to me but can be easily added.As in my other PR I adapted the tests and extended them a bit to better suit the new implementation. Additionally I also changed the
TestToFile
function, as in the other PR.If you'd like to accept both PRs, I also have a branch that currently holds all the changes,
Best regards
PS: The first commits have been reverted, as I created the branch after submitting my first PR and wanted to create two PRs for an easier review ;)