![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Default value of an element with mixed content >Thread Next - RE: Hiding namespace prefixes in the instance document Hiding namespace prefixes in the instance documentTo: xmlschema-dev@--.--- Date: 1/4/2006 1:18:00 PM Hi. I have a schema that imports another one. I’m trying to keep the namespace prefixes hidden in the xml instance and at the same time have namespaces defined for both schemas. I assume that this is not possible if both schemas have their own targetNamespaces. One way to do this would be the chameleon design, ie. use include instead of import and have no namespace definition in the imported schema. What are the downsides of this? Is the modularity somehow more restricted? Is there possibly some other options that I'm not recognising? Enclosing schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="importer:schema:namespace" xmlns:imported="imported:schema:namespace" targetNamespace="importer:schema:namespace" elementFormDefault ="qualified" attributeFormDefault="unqualified"> <xs:import namespace="imported:schema:namespace" schemaLocation="Imported_Schema.xsd"/> <xs:element name="ImporterSchema" type="ImporterType"/> <xs:complexType name="ImporterType"> <xs:sequence> <xs:element name="ImportedComplexType" type="imported:ImportedType" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:schema> Imported (common component) schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:imported="imported:schema:namespace" targetNamespace="imported:schema:namespace" elementFormDefault="unqualified" attributeFormDefault="unqualified"> <xs:complexType name="ImportedType"> <xs:sequence> <xs:element name="ImportedElement" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:schema> Generated instance document (not valid though, why?): <?xml version="1.0" encoding="UTF-8"?> <!--Sample XML file generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)--> <ImporterSchema xmlns="importer:schema:namespace" xmlns:imported="imported:schema:namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="importer:schema:namespace Importer_Schema.xsd"> <ImportedComplexType> <ImportedElement>String</ImportedElement> </ImportedComplexType> </ImporterSchema> _________________________________________ Antti Sissonen [Antti_Sissonen@h...] From george@o... Wed Jan 04 09:54:52 2006 Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.o | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
