Simple code to verify Saxon can load an XML file (and optionally schema)

夙愿已清 提交于 2020-03-06 09:43:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!