eclipse:使用xsd验证xml [英] eclipse: validate xml with xsd
问题描述
这是我的xml开始的方式:
does anyone know if it is possible to validate an xml with an xsd while i am editing the xml in eclipse?
有没有人知道是否可以使用xsd验证一个xml, p>
this is how my xml begins:
<root
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../definitions.xsd">
推荐答案
右键单击并进行验证。如果未验证,则Eclipse无法到达XSD文件。 XML的父目录中的definitions.xsd是什么?您还可以为xsds定义 XML目录条目。无论如何,如果一切都很好,在保存期间应该验证XML。验证通常与元素和属性的代码完成一起。
Right click and Validate. If it is not validated, then Eclipse cannot reach the XSD file. Is definitions.xsd in the parent directory of the XML? You can also define XML catalog entries for your xsds. Anyway, if everything is fine, during saving it should validate XML. Validation usually come together with code completion of elements and attributes. They usually both work or neither.
更新:
图片使验证操作更加清晰:
Picture to make validate action more clear:
这篇关于eclipse:使用xsd验证xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!