我正在尝试读取xsd文件及其抛出如下exception:
cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[1-2][0-9]{3,3}(((0[1-9])|(1[0-2]))((0[1-9])|([0-2][0-9]|3[0-1])(([0-1][0-9]|2[0-3])([0-5][0-9]([0-5][0-9](\.[0-9]{1,4})?)?)?)?)?)?([+\-](0[0-9]|1[0-3])([0-5][0-9]))?' for type '#AnonType_valueTS'.
final Schema schema = schemaFactory.newSchema(this.getClass().getClassLoader().getResource("/schemaorg_apache_xmlbeans/src/mySchema.xsd"));
final Validator validator = schema.newValidator();
final StreamSource xmlFile = new StreamSource(new ByteArrayInputStream(xmlString.getBytes("utf-8")));
validator.validate(xmlFile);
Run Code Online (Sandbox Code Playgroud)
这个validator.validate(xmlFile)部分正在抛出exception.
任何想法?在此感谢您的帮助。
我已经查看了下面的内容:
值对于模式而言不是侧面有效的
| 归档时间: |
|
| 查看次数: |
26839 次 |
| 最近记录: |