[
Lists Home |
Date Index |
Thread Index
]
- From: Didier Perhirin <dperhirin@smtp2.cosmosbay.com>
- To: "'xml-dev@xml.org'" <xml-dev@xml.org>
- Date: Thu, 8 Jun 2000 19:03:34 +0200
Hi,
I'm currently working on the W3C XML Schema Working Draft 7 April 2000.
I have a question concerning the <import> element.
When I use such an element inside a schema, do the imported elements have
the same target namespace than the main schema, or do they keep their originating targetNamespace.
Concretely, if I have a schema imp_schema.xsd:
<xsd:schema targetNamespace="imported_schema_ns">
<xsd:element name="tag1"/>
</xsd:schema>
and a main schema main_schema.xsd, which imports it:
<xsd:schema targetNamespace="main_schema_ns"
xmlns:imp="imported_schema_ns">
<xsd:import namespace="imported_schema_ns" schemaLocation="imp_schema.xsd"/>
<xsd:element name="MainTag">
<xsd:complexType>
<xsd:element ref="imp:tag1"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Is the following instance of the main schema valid :
<x:MainTag xmlns:x="main_schema_ns"
xsi:schemaLocation="main_schema_ns main_schema.xsd">
<x:tag1/>
</x:MainTag>
or this next one is better:
<x:MainTag xmlns:x="main_schema_ns"
xmlns:y="imported_schema_ns"
xsi:schemaLocation="main_schema_ns main_schema.xsd">
<y:tag1/>
</x:MainTag>
I think the second one is right, but I still have some doubt ...
Thanks in advance for your answers,
Regards
Didier Perhirin
CosmosBay
mailto:dperhirin@cosmosbay.com
***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************
|