IBM Support

Restrictions in the processing of namespaces and qualified XML elements in generated XML-COBOL data conversion programs

Technote (FAQ)

This document applies only to the following language version(s):

Language Independent


Are there any restrictions in the processing of namespaces and qualified XML elements in the XML-COBOL data conversion programs that are generated for single-service projects?


The processing of namespaces and qualified elements in the generated XML-COBOL conversion programs has the following restrictions:

The following restrictions apply to inbound conversion (XML to COBOL):

a) Only the target namespace of the root element is recognized by the converter.
Note: Target namespaces can be assigned by prefixing an element with a namespace prefix (forming a QName) or declaring a default namespace.

b) There is no validation of leaf elements. Root element can optionally be validated. See the attribute GEN_VALIDATE_ROOT_IN_NS in CodegenProperty.

c) No distinction can be made for elements that differ only by namespace. For example, elements ″q:a″ and ″q1:a″ where q and q1 are bound to different namespaces in the message are treated as just ″a″.

For outbound conversion (COBOL to XML) the correct qualification prefixes and namespaces are generated based on the schemas for the XML message.

The following restrictions apply:


For optimization purposes, if all the elements of the outbound message are bound to the same
namespace, then the outbound converter qualifies them all implicitly, by using a default namespace. Figure 1 shows an example of an output message where the elements are implicitly qualified:

<?xml version="1.0" encoding="UTF-8"?>
<LONEPost xmlns=""
xsi:schemaLocation=" LONEI.xsd">

Figure 1. Example of Outbound Converter Message Using Implicitly Qualified Elements

If the outbound converter did not do this optimization, then the parameters in the output message would be generated in the format shown in Figure 2:

<?xml version="1.0" encoding="UTF-8"?>
<cbl:LONEPost xmlns:cbl=""
xsi:schemaLocation=" LONEI.xsd">

Figure 2. Example of Outbound Converter Message Using Explicitly Qualified Elements

Note: The contents of the structures in Figure 1 and Figure 2 are equivalent. However Figure 1 is a more efficient use of XML namespaces.

The outbound XML converter uses this optimization whenever possible to reduce the size of XML messages. This optimization has conservation benefits ranging from CPU time to network bandwidth.

b) MIXED elementForm VALUES

The optimization in the use of XML namespaces that is described in the previous section is possible only if the elementForm values (explicit or implicit) are the same for all mapped items.

Figure 3 is an example of an XML Schema with mixed elementForm values:

<schema xmlns=""
elementFormDefault="unqualified" attributeFormDefault="unqualified">

<complexType name="USAddress">
<!-- explcit Form="qualified" -->
<element name="name" type="string" form="qualified"/>

<!-- implicit Form="unqualified" -->
<element name="street" type="string"/>

Figure 3. Example of XML Schema with Mixed elementForm Values

For the schemas with mixed element qualification, the outbound converter generates the namespaces prefixes when required. For the previous schema with mixed element qualification (see Figure 3), the outbound converter generates a message containing the following fragment:

<addr:name>addr:name</addr:name> <!-- qualified -->
<street>street</street> <!--unqualified-->

Document information

More support for: Rational Developer for System z
General Information

Software version: 7.1

Operating system(s): Windows

Reference #: 1377103

Modified date: 2014-05-30