How can I validate XML against an XSD with distinct imports and namespaces?
Posted
by Pedrolopes
on Stack Overflow
See other posts from Stack Overflow
or by Pedrolopes
Published on 2010-06-02T16:22:42Z
Indexed on
2010/06/02
16:23 UTC
Read the original article
Hit count: 308
Hi there!!
I am trying to validate a few XML files and I'm failing due to various issues with the XSD definition and the namespaces...
This is public info, so no problem sharing data: the main XSD is at http://bioinformatics.ua.pt/euadr/euadr_types.xsd and it imports another XSD at the same location name common_types.xsd, I've validated them in W3C validator, and they passed.
The 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>
is straightforward and well-formed! I've tested a few online validators, and I'm getting the following error
cvc-elt.1: Cannot find the declaration of element 'relationship'.
Does anyone has any idea of what the problem is? Is it in the declaration of the namespaces? Of the XSD?
Thanks in advance for your help!
Cheers!
© Stack Overflow or respective owner