- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Netbeans 似乎拒绝 XSD 1.1 支持的某些 XSD 标签,例如“assert”:
cvc-complex-type.2.4.a : Invalid content found from the element 'xs:assert'. One of the values '{"http://www.w3.org/2001/XMLSchema":attribute, "http://www.w3.org/2001/XMLSchema":attributeGroup, "http://www.w3.org/2001/XMLSchema":anyAttribute}' is expected. [205]
我尝试使用 these examples 中的一些没有成功。我可以做什么来解决我的问题?
据我所知,我无需在 XSD 架构中指定我使用 XSD 1.1 的某些功能:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
最佳答案
这完全取决于您所说的“在 NetBeans 8.2 中使用 XSD 1.1” 的含义,但我假设您希望在 NetBeans 中使用上下文菜单条目验证 XML具有 XSD 1.1 功能(例如 assert)的 *.xsd 文件。如果我这样做,我会看到您报告的相同的“cvc-complex-type.2.4.a:找到无效内容...”错误。
无法自定义 Validate XML 命令使用的 validator ,显然它使用 JDK 的 javax.xml API 进行验证。 NetBeans 8.2 使用 Java 8,但是 even with JDK 9 there is no way to validate XSD 1.1 features :
Java 9.
...The big news is that finally we get the internal ports of Xerces updated. Oracle (and Sun before them) have been really slack in neglecting this so long: Java was stuck using Xerces 2.7.n for 11 years for goodness sake. The new ports are equivalent to Apache Xerces 2.11.0. (NOTE: XSD is still 1.0 only, the XSD 1.1 updates have not been put in place, but this probably reflects Apache Xerces’ slow pace to make the changes official.)
使用 Apache NetBeans 9.0 RC1 时也会出现同样的问题所以这个问题可能不会得到解决,直到:
我也没有看到任何有帮助的 NetBeans 插件。当然,仍然有第三方工具和(可能)Maven 项目配置可能有所帮助,但我没有看到仅使用 NetBeans 的解决方案。
关于java - 如何在 Netbeans 8.2 中使用 XSD 1.1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51173771/
我是一名优秀的程序员,十分优秀!