W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2006

Include/Import and namespace

From: Bruno Chatel <bcha@chadocs.net>
Date: Thu, 1 Jun 2006 15:07:19 +0200
Message-ID: <004b01c6857c$51111230$0600a8c0@chadocshome.com>
To: <xmlschema-dev@w3.org>
Cc: "Bruno Chatel" <bcha@chadocs.net>


I have two questions relative to inclusion and namespace.

1) Because of a software limitation, xs:include is not supported in my
application but xs:import is supported.

The schemas are written in modules, having the same target namespace.
Something like this :

description.xsd targetNamespace : http://www.xxx.fr/DOA/Madere 
    xs:include : xsd/ops-exch.xsd
    xs:import xsd/mathml2.xsd
    declares description element using complexType of ops-exch.
    and element of mathml    

ops-exch.xsd : targetNamespace: http://www.xxx.fr/DOA/Madere 
    xs:include ops-shared.xsd
    define complexType for description using elements of ops-shared.

ops-shared : targetNamespace : http://www.xxx.fr/DOA/Madere

mathml2.xsd : targetNamespace: http://www.w3.org/1998/Math/MathML

The contraints defined at http://www.w3.org/TR/xmlschema-1/#src-import
does not permit to simply change my xs:include by xs:import (because enclosing
 and imported can not have the same targetNamespace).

For info, many other schemas are defined with the same namespace.

Is there a way to build this only with xs:import ? I can change any namespace
declaration is all schemas (except MathML).

2) Always because of a sofware limitation (on a different sub-system), I need to declare
a specific targetnamespace for a "wrapper schema".
Using the previous example, something like this :

description-wrapper.xsd targetNamespace : http://www.xxx.fr/DOA/Madere/description
    xs:import description.xsd namespace: http://www.xxx.fr/DOA/Madere 
(nothing more in this schema)

This is valid, but when I try to check a document like this

<description xmlns:desc="http://www.xxx.fr/DOA/Madere/description" 
xsi:schemaLocation="http://www.xxx.fr/DOA/Madere/description ./description-wrapper.xsd" 
code="00005569.0001001" revdate="2006-03-02T09:30:12">
 <descbody code="code">

Xerces raises an error : cvc-elt:1 : cannot find the declaration of element 'description'
But description is declared in description with targetNamespace http://www.xxx.fr/DOA/Madere 
Is it normal ?

Thanks in advance


Bruno Chatel
Tel : (+33) (0)4 96 11 14 57
Received on Thursday, 1 June 2006 13:06:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:10 UTC