[英]How can I validate XML against an XSD with distinct imports and namespaces?
我正在尝试验证一些XML文件,但由于XSD定义和名称空间的各种问题而失败了...
这是公共信息,因此共享数据没有问题:主要的XSD位于http://bioinformatics.ua.pt/euadr/euadr_types.xsd,并且在相同位置导入了另一个XSD,名为common_types.xsd ,我已经对其进行了验证在W3C验证程序中,他们通过了。
XML
<?xml version="1.0"?>
<relationship xmlns="http://euadr.biosemantic.erasmusmc.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://euadr.biosemantic.erasmusmc.org/ http://bioinformatics.ua.pt/euadr/euadr_types.xsd">
<sourceId>
<source>SMILE</source>
<code>[S]1(=O)(=O)N(C(</code>
</sourceId>
<targetId>
<source>UP</source>
<code>P35354</code>
</targetId>
<creator>http://cgl.imim.es</creator>
<observationDateTime>2010-05-12T19:03:40.097+02:00</observationDateTime>
<informationSources>
<informationSource>
<relationshipType>BINDS</relationshipType>
<interaction>
<type>pIC50</type>
<value>6.55</value>
</interaction>
<evidence>
<type>OBSERVATIONAL</type>
<value>1.0</value>
</evidence>
<databaseIds>
<databaseId>
<source>PDSP</source>
<code>
P35354</code>
</databaseId>
</databaseIds>
</informationSource>
</informationSources>
</relationship>
简单明了! 我已经测试了一些在线验证器,但出现以下错误
cvc-elt.1: Cannot find the declaration of element 'relationship'.
有谁知道是什么问题吗? 它在名称空间的声明中吗? XSD的?
在此先感谢您的帮助!
干杯!
您的架构定义了一个复杂的类型,称为“ relationship
但未定义任何名为“ relationship
元素。 您需要在第一个XSD中添加以下内容:
<xs:element name="relationship" type="relationship" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.