
Hi, Sorin: We use eXist 1.2.3. I set up the config.xml validation=yes. I also copied our schema files into this folder: \eXist\webapp\WEB-INF\entities Then I add the name and uri in the catalog.xml: ( I just added the three lines of our own schemas in the <uri name= > in the default catalog.xml.) Catalog.xml <!-- $Id: catalog.xml 6282 2007-07-23 18:49:56Z dizzzz $ --> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <uri name="http://www.w3.org/XML/1998/namespace" uri="entities/xml.xsd"/> <uri name="http://www.w3.org/2001/XMLSchema" uri="entities/XMLSchema.xsd"/> <uri name="http://localhost:8080/exist/db/Test/common/schemas/work" uri="entities/works.xsd"/> <uri name="http://localhost:8080/exist/db/Test/common/schemas/about" uri="entities/about.xsd"/> <uri name="http://localhost:8080/exist/db/Test/common/schemas/common" uri="entities/common.xsd"/> <uri name="urn:oasis:names:tc:entity:xmlns:xml:catalog" uri="entities/catalog.xsd" /> </catalog> This is how I define in our xml record: <work xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://localhost:8080/exist/db/Test/common/schemas/work"> </work> But the setting doesn't seem work because the records are not validated by the schema at all. For example, if we delete a required field, the record is still validated. But if I tried to save a record, the error message appears. I don't know whether it's caused by eXist setting or by Oxygen, or the connection between them. Any suggestion is welcome! Thanks. Jenny -----Original Message----- From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] On Behalf Of oxygen-user-request@oxygenxml.com Sent: Friday, August 08, 2008 1:00 PM To: oxygen-user@oxygenxml.com Subject: oXygen-user Digest, Vol 59, Issue 3 Send oXygen-user mailing list submissions to oxygen-user@oxygenxml.com To subscribe or unsubscribe via the World Wide Web, visit http://www.oxygenxml.com/mailman/listinfo/oxygen-user or, via email, send a message with subject or body 'help' to oxygen-user-request@oxygenxml.com You can reach the person managing the list at oxygen-user-owner@oxygenxml.com When replying, please edit your Subject line so it is more specific than "Re: Contents of oXygen-user digest..." Today's Topics: 1. Failed to read schema document (Jing, Jenny) 2. Re: Failed to read schema document (Sorin Ristache) ---------------------------------------------------------------------- Message: 1 Date: Thu, 7 Aug 2008 23:21:07 -0400 From: "Jing, Jenny" <jjing@hbs.edu> Subject: [oXygen-user] Failed to read schema document To: "oxygen-user@oxygenxml.com" <oxygen-user@oxygenxml.com> Message-ID: <18EA3ABA6E54124EB3CE222C13F68A460127FCFE8F58@WINHBSMAIL01.hbs.edu> Content-Type: text/plain; charset="us-ascii" Hi, I'm trying to set up eXist to validate records with schema. But I keep getting error message when I tried to save a record in eXist. Cannot save the file. org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'file:/export/home/library/eXist/webapp//WEB-INF/entities/works.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. Does anyone know what might cause this error message? The schema's root is <xsd:schema> I am sure about that. Thanks. Jenny ------------------------------ Message: 2 Date: Fri, 08 Aug 2008 15:13:03 +0300 From: Sorin Ristache <sorin@oxygenxml.com> Subject: Re: [oXygen-user] Failed to read schema document To: "oxygen-user@oxygenxml.com" <oxygen-user@oxygenxml.com> Message-ID: <489C384F.2020402@oxygenxml.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hello, I get this error when the schema used for validation cannot be found at the location specified in the XML document. In your case if there is a works.xsd file on the hard disk and the root element of the works.xsd file is xsd:schema the location is not specified correctly in the XML document. Does works.xsd exist in the directory specified in the XML document that you try to add to eXist? /export/home/library/eXist/webapp/WEB-INF/entities/works.xsd If it exists what is the version of your eXist server? Regards, Sorin Jing, Jenny wrote:
Hi,
I'm trying to set up eXist to validate records with schema. But I keep getting error message when I tried to save a record in eXist.
Cannot save the file. org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'file:/export/home/library/eXist/webapp//WEB-INF/entities/works.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
Does anyone know what might cause this error message? The schema's root is <xsd:schema> I am sure about that.
Thanks.
Jenny
------------------------------ _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user End of oXygen-user Digest, Vol 59, Issue 3 ******************************************

Hello Jenny, You can get different validation results when saving the XML file in the eXist database and when validating the same XML file in an Oxygen editor panel if the two validations are executed against different schemas. When you save the XML file the eXist server validates the file against \eXist\webapp\WEB-INF\entities\works.xsd through the eXist XML catalog that maps the namespace "http://localhost:8080/exist/db/Test/common/schemas/work" to the schema \eXist\webapp\WEB-INF\entities\works.xsd. When you validate the same XML file opened in an XML editor panel in Oxygen with the toolbar action Validate Document other XML Schema file may be used. Oxygen uses the same schema file as the eXist server only if you associate the same schema file with the XML file with one of the following: - the xsi:schemaLocation attribute in the XML file, - a document type created in Preferences -> Document Type Association, - an XML catalog set in Preferences -> XML -> XML Catalog. You can find the schema used in Oxygen with the action Open External Schema available on the toolbar Document and on the menu Document -> XML Document. Regards, Sorin Jing, Jenny wrote:
Hi, Sorin:
We use eXist 1.2.3. I set up the config.xml validation=yes. I also copied our schema files into this folder: \eXist\webapp\WEB-INF\entities Then I add the name and uri in the catalog.xml:
( I just added the three lines of our own schemas in the <uri name= > in the default catalog.xml.) Catalog.xml <!-- $Id: catalog.xml 6282 2007-07-23 18:49:56Z dizzzz $ --> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <uri name="http://www.w3.org/XML/1998/namespace" uri="entities/xml.xsd"/> <uri name="http://www.w3.org/2001/XMLSchema" uri="entities/XMLSchema.xsd"/>
<uri name="http://localhost:8080/exist/db/Test/common/schemas/work" uri="entities/works.xsd"/> <uri name="http://localhost:8080/exist/db/Test/common/schemas/about" uri="entities/about.xsd"/> <uri name="http://localhost:8080/exist/db/Test/common/schemas/common" uri="entities/common.xsd"/> <uri name="urn:oasis:names:tc:entity:xmlns:xml:catalog" uri="entities/catalog.xsd" /> </catalog>
This is how I define in our xml record: <work xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://localhost:8080/exist/db/Test/common/schemas/work"> </work>
But the setting doesn't seem work because the records are not validated by the schema at all. For example, if we delete a required field, the record is still validated. But if I tried to save a record, the error message appears.
I don't know whether it's caused by eXist setting or by Oxygen, or the connection between them.
Any suggestion is welcome!
Thanks.
Jenny
participants (2)
-
Jing, Jenny
-
Sorin Ristache