You can import an XML Schema file with a target namespace even if the message set does not have namespaces enabled.
When you import an XML Schema file with a target namespace into a message set for which namespaces have not been enabled, the created message definition file is placed in the noTarget XML namespace. In some cases, this action can lead to name conflicts if global constructs have the same name in different namespaces in the XML Schema files imported into the same message set. These conflicts cause error entries in the task list which you must resolve before generating the model in another format, such as a message dictionary.
Because all the message definition files are in the noTarget XML namespace, the namespace information associated with the XML schema file is lost. However, the importer provides a limited form of namespace support by prefixing the XML names in the XML Wire Format layers with a namespace prefix. To allow this namespace support to work, an XML Schema file imported must specify an xmlns attribute with a non-empty prefix for the target namespace of the XML Schema file. This prefix is used in the XML names in the XML Wire Format layers.
Therefore you cannot specify the target namespace of the XML file as the default namespace. Each namespace in the XML schema files must use a unique prefix and the same namespace must always use the same prefix. Any XML instance documents, against which you match any of the forms generated from the model, must also use the same prefixes for the namespaces.
The XML Schema importer creates a number of optional attributes in an attribute group to represent namespace information. This attribute group is referenced by the type of any message. An attribute is created to represent the schema location of the XML schema file, and an attribute is created to represent the mapping of the prefix to the http://www.w3.org/2001/XMLSchema-instance namespace. An attribute is also created for each xmlns attribute in the XML Schema document.
When importing using the Message Definition File wizard the prefix http://www.w3.org/2001/XMLSchema-instance namespace can be changed and additional namespace URI/prefix pairs added using the last panel of the Message Definition File wizard. When you use the mqsicreatemsgdefs command line utility, the same modifications can be made using the XML options file.
For details about XML Schema, see XML Schema Part 0: Primer on the World Wide Web Consortium (W3C) Web site.