XML Schema validation and XInclude

Hi, I have some XML Schemas that xs:import the xml namespace attributes (xml:base so I can use XInclude and be able to validate it). I am getting a validation error on the schemas themselves when I try to validate in oxygen saying they can't find the xml.xsd which is in the same directory as the import schema. Here is the error message: Description: W schema_reference.4: Failed to read schema document 'xml.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>. URL: http://www.w3.org/TR/xmlschema-1/#schema_reference When I use JARV/MSV the schemas validate (and so does the instance document). Is this a bug in oxygen or perhaps xerces? I am using oxygen 6.1 and Mac OS X. (I have also tried using xs:anyAttribute with the xml namespace and neither oxygen or JARV validates the instance document.) Here is a test schema and a xml.xsd: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/> </xs:schema> <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <xsd:attribute name="base"/> </xsd:schema> best, -Rob

Hi Rob, We are not able to reproduce that, please make sure both files are saved on disk. If you still have problems it may help if you send your files attached. In any case it is recommended to upgrade to the latest oXygen 6 release, version 6.2. For the schema for XML please use the official schema, eventually you can refer to it using its remote location and resolve that to a local copy through an XML Catalog file. http://www.w3.org/2005/08/xml.xsd Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Robert Koberg wrote:
Hi,
I have some XML Schemas that xs:import the xml namespace attributes (xml:base so I can use XInclude and be able to validate it). I am getting a validation error on the schemas themselves when I try to validate in oxygen saying they can't find the xml.xsd which is in the same directory as the import schema. Here is the error message:
Description: W schema_reference.4: Failed to read schema document 'xml.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>. URL: http://www.w3.org/TR/xmlschema-1/#schema_reference
When I use JARV/MSV the schemas validate (and so does the instance document).
Is this a bug in oxygen or perhaps xerces? I am using oxygen 6.1 and Mac OS X.
(I have also tried using xs:anyAttribute with the xml namespace and neither oxygen or JARV validates the instance document.)
Here is a test schema and a xml.xsd:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/> </xs:schema>
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <xsd:attribute name="base"/> </xsd:schema>
best, -Rob _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

George Cristian Bina wrote:
Hi Rob,
We are not able to reproduce that, please make sure both files are saved on disk. If you still have problems it may help if you send your files attached. In any case it is recommended to upgrade to the latest oXygen 6 release, version 6.2. For the schema for XML please use the official schema, eventually you can refer to it using its remote location and resolve that to a local copy through an XML Catalog file. http://www.w3.org/2005/08/xml.xsd
Thanks George. I can get a valid schema if I use the URL above (but not copying down to my local filesystem). And after upgrading to 6.2 the test schema from the previous post works. But if I use the attached schema with my modified xml.xsd it cannot find the xml.xsd (both files live in the same directory): <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <xsd:attribute name="base"/> </xsd:schema> As I am only using the xml.xsd because XInclude places the xml:base attribute on the included root element, I want it as small as possible (and no network effect or catalog resolver in my runtime). thanks, -Rob

Hi Rob, We were not able to reproduce the problem. Please send an attachment with all the files you test with placed in an archive so we can test the same thing. Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Robert Koberg wrote:
George Cristian Bina wrote:
Hi Rob,
We are not able to reproduce that, please make sure both files are saved on disk. If you still have problems it may help if you send your files attached. In any case it is recommended to upgrade to the latest oXygen 6 release, version 6.2. For the schema for XML please use the official schema, eventually you can refer to it using its remote location and resolve that to a local copy through an XML Catalog file. http://www.w3.org/2005/08/xml.xsd
Thanks George. I can get a valid schema if I use the URL above (but not copying down to my local filesystem). And after upgrading to 6.2 the test schema from the previous post works. But if I use the attached schema with my modified xml.xsd it cannot find the xml.xsd (both files live in the same directory):
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <xsd:attribute name="base"/> </xsd:schema>
As I am only using the xml.xsd because XInclude places the xml:base attribute on the included root element, I want it as small as possible (and no network effect or catalog resolver in my runtime).
thanks, -Rob
------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?> <xs:schema elementFormDefault="qualified" targetNamespace="http://livestoryboard.com/schemas/lsb" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://livestoryboard.com/schemas/lsb" xmlns:xml="http://www.w3.org/XML/1998/namespace"> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2005/08/xml.xsd"/> <!-- --> <xs:complexType name="InteractionComponent"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="param"/> <xs:element ref="param-ref"/> <xs:element ref="redirect"/> </xs:choice> <xs:attribute name="classname" type="xs:string"/> </xs:complexType> <xs:complexType name="ViewType"> <xs:complexContent> <xs:extension base="InteractionComponent"/> </xs:complexContent> </xs:complexType> <xs:complexType name="TransformView"> <xs:complexContent> <xs:extension base="ViewType"> <xs:attribute name="xslref" use="required"/> <xs:attribute name="xmlref" use="optional"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="ValidatorType"> <xs:complexContent> <xs:extension base="InteractionComponent"/> </xs:complexContent> </xs:complexType> <xs:element name="interactions"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element ref="param"/> <xs:element name="interaction"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="2"> <xs:choice minOccurs="0" maxOccurs="1"> <xs:element name="view" type="ViewType"/> <xs:element name="manager-transform-view" type="TransformView"/> </xs:choice> <xs:choice minOccurs="0" maxOccurs="1"> <xs:element name="validator" type="ValidatorType"/> </xs:choice> </xs:sequence> <xs:attribute name="id" type="xs:ID"/> <xs:attribute name="siteref" type="xs:anyURI"/> </xs:complexType> </xs:element> </xs:choice> <xs:attribute ref="xml:base"/> <!--<xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/>--> </xs:complexType> </xs:element> <xs:element name="redirect"> <xs:complexType> <xs:attribute name="name" type="xs:ID"/> <xs:attribute name="interactionref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="param"> <xs:complexType> <xs:attribute name="id" type="xs:ID" use="optional"/> <xs:attribute name="name" type="xs:string"/> <xs:attribute name="value" type="xs:string"/> </xs:complexType> </xs:element> <xs:element name="param-ref"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:schema>

George Cristian Bina wrote:
Hi Rob,
We were not able to reproduce the problem. Please send an attachment with all the files you test with placed in an archive so we can test the same thing.
OK. I just used a PC with the oxygen 6.2 and it worked fine using the files that live on the mac (i.e. the mac is the file server for my test). It doesn't work on the mac. I had installed the latest apple jdk1.5 release candidate so maybe that is the problem. (I have changed the system JAVA_HOME to 1.5 against recommendations...) So, nevermind :( Sorry for the bother, -Rob
participants (2)
-
George Cristian Bina
-
Robert Koberg