问题
[In this question][1] it was recommended I look at the Saxon EE validate example. Where can I download it? It's not in [this] [2] or [this] [3].
[1]: https://stackoverflow.com/questions/60252919/simple-code-to-verify-saxon-can-load-an-xml-file-and-optionally-schema?noredirect=1#comment106577884_60252919
[2]: https://www.saxonica.com/download/saxon-resources9-9.zip
[3]: https://www.saxonica.com/download/dotnet.xml
回答1:
I think Martin Honnen may have answered your question in a comment on the original question?
The resources ZIP that you reference as [2]
has folders samples/java
and samples/cs
with Java and C# examples respectively; both include sample code for invoking XSD validation. The C# version is at line 2550 of ExamplesEE.cs.
An alternative approach is to use a DocumentBuilder having first called setSchemaValidator() to make it do schema validation while building.
来源:https://stackoverflow.com/questions/60253537/where-can-i-download-the-saxon-validate-example