[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XML Schema: Import and namespace question
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@c... *************************************************************************** This is xml-dev, the mailing list for XML developers. To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev List archives are available at http://xml.org/archives/xml-dev/ ***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|