Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我们使用 Oxygen XML 编辑器从 XML Schema 生成 XML 时,如何在 XML 模式中编写如下注释并且需要在 XML 中显示。
< THIS is a request for BUSINESS >
以上显示在评论标签中
首先请注意,您请求的“评论”应该是
<!-- < THIS is a request for BUSINESS > -->
因为您请求的表单在 XML 中是不允许的(但当您提到“以上显示在评论标签中”时,这可能就是您的意图)。
XSD 的目的是验证 XML 文档。虽然可以并且已经编写了工具来从 XSD 生成有效的 XML 文档,但没有理由期望这些工具将注释或注释传递给它们创建的 XML 文档。
请考虑使用 XSLT 脚本来使用您希望添加的附加注释来扩充生成的 XML。