阅读背景:

使用XMLSchema配置解析代码中的XML验证:最佳实践? (JAVA)

来源:互联网 

I have to parse a XML configuration file. I decided to do the basic validation with XMLSchema to avoid massive amounts of boilerplate code for validation. Since the parsing class should work for itself i was wondering: "How can i validate the incoming XML file with XMLSchema without having the XMLSchema stored on disc where it can be modified by third parties?" I know i can load the XMLSchema from an arbitrary InputStream, but the Schema itself must be stored somewhere. (And putting the Schema in a huge String object sounds like a very very bad idea) Has someone already did this? What are the best solution for such cases?I have to parse a XML configuration file. I dec




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: