cancel
Showing results for 
Search instead for 
Did you mean: 

how to implement custom schema ?

jeremie_
Confirmed Champ
Confirmed Champ

hi, i m practicing with nuxeo sdk and try to register a new schema like explained here http://doc.nuxeo.com/display/NXDOC/Document+types.

Unfortunatly, each time, i encounter the following error :

ERROR [org.nuxeo.ecm.core.schema.XSDLoader] FatalError: Premature end of file.
/> ERROR [org.nuxeo.ecm.core.schema.TypeService] org.xml.sax.SAXParseException: Premature end of file.

and the schema file became totaly empty.

Did i miss something ?

1 ACCEPTED ANSWER

bruce_Grant
Elite Collaborator
Elite Collaborator

You need to close the tag with the namespace prefix as well as schema as bjalon pointed out. For example

<?xml version="1.0"?>
<xs:schema targetNamespace="http://www.nuxeo.org/dam/schemas/dam/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  xmlns:nxs="http://www.nuxeo.org/dam/schemas/dam/">
  <xs:element name="client" type="xs:string" />
  <xs:element name="brandMake" type="xs:string" />
  <xs:element name="productModel" type="xs:string" />
</xs:schema>

View answer in original post

9 REPLIES 9

bruce_Grant
Elite Collaborator
Elite Collaborator

Can you post the contents of your contribution file?

jeremie_
Confirmed Champ
Confirmed Champ

Here's the last try

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Did you see your <xs

jeremie_
Confirmed Champ
Confirmed Champ

no, but i guess it's closed by </schema><br />

Florent_Guillau
World-Class Innovator
World-Class Innovator

This is invalid XML. Please use a XML editor and validator to write XML, don't write it by hand.

bruce_Grant
Elite Collaborator
Elite Collaborator

You need to close the tag with the namespace prefix as well as schema as bjalon pointed out. For example

<?xml version="1.0"?>
<xs:schema targetNamespace="http://www.nuxeo.org/dam/schemas/dam/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  xmlns:nxs="http://www.nuxeo.org/dam/schemas/dam/">
  <xs:element name="client" type="xs:string" />
  <xs:element name="brandMake" type="xs:string" />
  <xs:element name="productModel" type="xs:string" />
</xs:schema>

thank you, so i just closed the schema like you did, double check the file...and still have the same error.

Then your file is still not valid XML. We can't help you without seeing the exact file (use pastebin.com for instance to show it to us), and anyway you should be able check by yourself that the XML is valid or not, there are many many tools to do it.

Finally, i should have checked the file one more time. it's working now with the closing </xs