One Message Definition File can reuse message model objects defined in another Message Definition File. There are two mechanisms that XML Schema provides to do this: import and include. The namespaces of the two files determine which of import or include should be used:
Target file has a target namespace | Target file has notarget namespace | |
---|---|---|
Parent file has a target namespace | xsd:import | xsd:include1 |
Parent file has notarget namespace | xsd:import | xsd:include |
When import or include are used, global objects from the target file can be used in the parent file. For example, an element in the parent file can be given a complex type defined in the target file.
The namespace of objects in the target file is preserved in the parent file, with the exception noted in the previous table of a target namespace file including a notarget namespace file. This exception is sometimes called the chameleon namespace effect.
Chameleon namespaces have limited support when used with the MRM domain. When referenced in the parent file, the objects in the target file appear in the namespace of the parent file, but they are assigned default physical format information. In other words, physical format information defined in the target file is not available for use in the parent file. Only use Chameleon Namespaces in the MRM domain to model XML messages where physical format information has not changed from the default.
XML Schema provides a variation of xsd:include called xsd:redefine, which is not supported by WebSphere Message Broker. Using xsd:redefine will give a task list error. A Quick Fix is offered to convert occurrences of xsd:redefine into xsd:include.