Why nxs:stringList isn't resolve in my_schema.xsd ?

Hello,

Here is my_schema.xsd :

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://my_company/schemas/nuxeo/"
           xmlns:enacCommon="http://my_company/schemas/nuxeo/"
           xmlns:nxs="http://www.nuxeo.org/ecm/schemas/common/">  
<xs:include schemaLocation="base.xsd" />
<xs:element name="intext" type="xs:string" />
<xs:element name="site" type="nxs:stringList" /> 
</xs:schema>

Eclipse dit : src-resolve.4.2: Error resolving component 'nxs:stringList'. It was detected that 'nxs:stringList' is in namespace 'http://www.nuxeo.org/ecm/schemas/common/', but components from this namespace are not referenceable from schema document 'file:///chemin_vers_mon_pluggin/src/main/ resources/schemas/my_schema.xsd'. If this is the incorrect namespace, perhaps the prefix of 'nxs:stringList' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:///chemin_vers_mon_pluggin/src/main/resources/schemas/ docDessinSPCET.xsd'.

And in run, nuxeo server says : 2012-11-08 15:47:17,075 ERROR [org.nuxeo.ecm.core.schema.XSDLoader] Error: undefined simple or complex type 'nxs:stringList' 2012-11-08 15:47:17,075 ERROR [org.nuxeo.ecm.core.schema.TypeService] org.xml.sax.SAXParseException; systemId: file:/chemin_de_mon_installation/nuxeo-cap-5.6-tomcat-sdk/nxserver//schemas/docDessinSPCET.xsd; lineNumber: 8; columnNumber: 51; undefined simple or complex type 'nxs:stringList'

Someone has an idea ?

Thanks !

0 votes

1 answers

3718 views

ANSWER



Your xmlns:nxs must be the same as your targetNamespace, as the xs:include does not bring in the included file's namespace.

0 votes



Hello,

Sorry but i don't understand very well, I put the same xmlns:nxs and targetNamespace so for example :

targetNamespace=&quot;http://www.nuxeo.org/ecm/schemas/common/&quot;
xmlns:nxs=&quot;http://www.nuxeo.org/ecm/schemas/common/&quot;&gt;  

But it seems that the include is bad ? I think that I have to modify the schemaLocation but how ? I have to import the file base.xsd into my pluggin from the sources of nuxeo 5.6 ? Or I have to modify the path to the file base.xsd ad if yes, with which path ?

&lt;xs:include schemaLocation=&quot;which_path?/base.xsd&quot; /&gt;

Of course, if I add the lines of the type's definition found in base.xsd of nuxeo 5.6, it's ok :

  &lt;xs:complexType name=&quot;stringList&quot;&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element name=&quot;item&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;
        maxOccurs=&quot;unbounded&quot; /&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;

Thansk for your response.

11/09/2012

This is not an answer, please don't post it as an answer. Post it as a comment to either the previous answer or the original question.
11/09/2012