Software AG Products 10.7 | Service Development Help | Working with Document Types | Creating an IS Document Type | Determining How to Represent Complex Types in Document Types
 
Determining How to Represent Complex Types in Document Types
Integration Server processes complex types from an XML Schema in one of two ways, depending on an option you select when you create a new IS document type. One way is to expand the complex type as an “inline” document in the editor. The other way is to generate a separate IS document type for each complex type in the schema, with references to those document types.
Example XML Schema
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://usecases/xsd2doc/01"
xmlns:uc="http://usecases/xsd2doc/01" >
<xsd:element name="eltA" type="uc:documentX" />
<xsd:complexType name="documentX">
<xsd:sequence>
<xsd:element name="eltX_E" type="xsd:string" />
<xsd:element name="eltX_F" type="uc:documentY" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="documentY">
<xsd:sequence>
<xsd:element name="eltY_G" type="xsd:string" />
<xsd:element name="eltY_H" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
If you select the option to expand complex types inline, the schema processor generates the document type as follows. In this example, the schema processor expanded the complex types named documentX and documentY inline within the new IS document type:
Complex types expanded inline
If you select the option to generate complex types as separate document types, the schema processor generates the document types as follows. In this example, the schema processor generated three IS document types—one for the complex type named documentY, one for the complex type named documentX (with a reference to documentY), and one for the root element eltA (with references to documentX and documentY):
Complex types generated as separate document types
The schema processor generates all three document types in the same folder.
Note:
If the complex type is anonymous, the schema processor expands it inline rather than generate a separate document type.
If the XML Schema you are using to generate an IS document type contains recursive complex types (that is, element declarations that refer to their parent complex types directly or indirectly), you can avoid errors in the document type generation process by selecting the option to generate complex types as separate document types. (Selecting the option to expand complex types inline will result in infinitely expanding nested documents.)