New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added XML repair functionality to fix #14 #16
Conversation
Update from base
The appveyor build seems to have included the 7z libraries and the readme... but not the Legends Viewer executable. |
Not sure how the AppVeyor settings were set up for Parker147's account, but it was outputting ok on mine (using a powershell script). I have added 'appveyor.yml' config file that will ensure AppVeyor builds and outputs it the same. Not saying these are the best settings - just that they work - happy for them to be changed. In addition to the normal executable, I specifically added a zip output to the PS script, this adds all the files that are found in the DFFD download of LegendsViewer (the DLLs, exe, readme) rather than including everything (eg: the PDB file). |
XML.WhitespaceHandling = WhitespaceHandling.Significant; | ||
} | ||
|
||
public static string SafeXMLFile(string xmlFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is unnecessary. We should just be catching the exceptions thrown by our own Parse function instead of the XDocument.Load. If a file doesn't have an error it has to be parsed twice, once by XDocument and then once by our own XMLParser. XDocument is way less intense, so it may be negligible for smaller files, but I feel like it would still add some time for bigger files.
Yeah I played around with AppVeyor since I saw that you were using it and it looked nice, but didn't take the time to figure out how I could make it package all the build artifacts for me. That yml is a good addition. |
With regards to the function - I split it away from the main handing so it can be modified/improved if any other common XML issues come up. I tried my code on the largest export I had at hand (~450Mb uncompressed) and it didn't seem to have a significant impact on the load time, however this was only a basic test using a couple of PCs I have access to. Give me a few and I'll move the try/catch around the |
No description provided.