问题
This is for a tool in our system that will verify that it can load an XML file with Saxon, and list any problems. So I want to have Saxon load the file and throw an exception if it can't fully parse it. This test has an option to be given a schema file so it validates against the schema if it exists.
And then push the read in XML to an XmlDocument to display in a window.
All the examples I've found are a lot more complex than this. Is there an example somewhere that shows how to just read it and then push it to an XmlDocument?
And if possible, get a list of errors it found parsing.
来源:https://stackoverflow.com/questions/60252919/simple-code-to-verify-saxon-can-load-an-xml-file-and-optionally-schema