【发布时间】:2009-10-27 11:54:22
【问题描述】:
我想使用 SAXParser 或 XMLReader 解析 xml 文件并验证该文件是否符合特定的 xsd 文件 (new File( "example.xsd" ))。
很容易
在额外的步骤中使用
Validator对xsd 文件进行验证,如this SO answer。在解析时通过将 xsd 的名称指定为
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"来进行验证,就像在 this SO answer 中一样。
但是我如何在解析时验证new File( "example.xsd" )?
【问题讨论】: