|
From: Swami K. <swa...@gm...> - 2008-04-06 14:49:22
|
Ok - I tried a different approach... This time I am keeping all my schemas in the WEB-INF/entities folder, and I am using namespaces. Catalog entry: <uri name="http://www.ishafoundation.org/archives/2008/reference" uri="./entities/reference.xsd" /> Schema root element: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ishafoundation.org/archives/2008/reference" > Instance root element: <r:reference xmlns:r="http://www.ishafoundation.org/archives/2008/reference"> <r:keywords> <r:keyword id="death" name="Death"/> <r:keyword id="life" name="Life"/> ..... But now when I try and add the document I get the following error message: Impossible to store a resource C:\Documents and Settings\ref_01.xml: org.xml.sax.SAXParseException: src-resolve.4.1: Error resolving component 'keywords'. It was detected that 'keywords' has no namespace, but components with no target namespace are not referenceable from schema document 'file:/C:/Program%20Files/eXist/webapp//WEB-INF/entities/reference.xsd'. If 'keywords' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'keywords' has no namespace, then an 'import' without a "namespace" attribute should be added to 'file:/C:/Program%20Files/eXist/webapp//WEB-INF/entities/reference.xsd'. As you can see - I am prefixing all the elements in the instance document with the prefix "r". Is this a bug? See this link: http://forums.java.net/jive/message.jspa?messageID=264177 http://forums.java.net/jive/message.jspa?messageID=264177 If this is a bug - is there any work around? Kind Regards Swami Kevala Swami Kevala wrote: > > Hello, > > I am not able to get the implicit validation working when I do not have > namespaces defined for my documents. > > I have a file called reference.xml which is defined like this: > > <reference xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:noNamespaceSchemaLocation="reference.xsd"> > > I need to periodically update this reference file, and then reload it into > eXist, overwriting the existing file. I would like the implicit validation > switched on for this. Looking at the examples, it only deals with the > cases where the documents have namespaces defined. How do I configure > validation to work without using namespaces on my document. i.e. what do I > need to put in the @name attribute on the uri catalog element > > I see that this question has already been asked in this forum, but you > refer to the eXist wiki for the answer, which does not seem to be > currently available. > > Also, I see that it is possible to store the catalog.xml file within the > database, but is it also possible to store the xsds within the database > instead of within the WEB-INF/entities folder? > > Many Thanks > > Swami Kevala > -- View this message in context: http://www.nabble.com/Implicit-Validation-with-no-namespaces-tp16512054p16525176.html Sent from the exist-open mailing list archive at Nabble.com. |