Rational Developer for System z, Version 7.6

XMLNameSelection

Use this element to provide the mapping of the original COBOL elements to the new XML element names.
There are some important aspects to consider when you use this element:
  • No error checking is done to ensure the xmlName attribute value is in fact a valid XML element name.
  • Only the batch specification files support alternate name specification. The GUI wizard does not have that capability.
  • The XMLNamesArray and the xsdElemName attributes of the XsdSpec elements should not be used to alter the same level 01 COBOL item in the same message specification. Use one or the other but not both in the same specification.
  • Element and type names formation is similar to name formation applied to the default names subject to the following rules:
    • If non-level 01 COBOL item name or its alternate name is all upper case, the corresponding XML schema type if any and the XML element name will be all lower case
    • If non-level 01 item name or its alternate name is not all upper case, the corresponding XML schema type, if any, and the XML element name will preserve the case of the specification
    • The case of level 01 item name will always have the case of the original COBOL name of the xmlName attribute specification
    • All hyphens are removed from level 01 item names
    • One or more hyphens are replaced by a single underscore in non-level 01 item names. COBOL names that differ only by the number of hyphens are not supported. The schemas generated from COBOL data containing items with such names under the same group item will have duplicate element names and may not be valid

Contained by

XMLNamesArray

Contains

None

Attributes

Fields Description

Attribute: itemName
Valid values: See Description
Required?: Yes
Default value: None

Specifies the name of the COBOL data item for which the alternate name is desired. The value of this attribute must specify a valid COBOL data item name prefixed with dot-separated parent names as shown in the following example. Only this COBOL data item is affected

Attribute: xmlName
Valid values: See Description
Required?: Yes
Default value: None

Specifies the name from which the XML names in generated schemas and WSDL files will be derived. This name will be used rather than the name of the COBOL data item.

Example

(1) Assuming the COBOL language structure shown in Figure 1
Figure 1. Example of COBOL Language Structures for XMLNameSelection Element
1 A.
         2 B.
           3 C                    pic x(10).
           3 D                    pix x(2).
.

(2) Figure 2 is an example of specifying alternate names for the three data items A, B, and C shown in Figure 1.
Figure 2. Example of Alternate Names of COBOL Language Structures for XMLNameSelection Element
<ItemSelectionArray>
  <ItemSelection itemName="A.B.C"/>
</ItemSelectionArray>
<XMLNamesArray>
  <XMLNameSelection itemName="A.B.C" xmlName="XMLC"/>
  <XMLNameSelection itemName="A.B" xmlName="XMLB"/>
  <XMLNameSelection itemName="A" xmlName="XMLA"/>
</XMLNamesArray>

(3) Given the specification provided per Figure 1 and Figure 2, Figure 3 is an example of the schema that is generated.
Figure 3. Example of the Generated Schema for COBOL Language Structures for XMLNameSelection Element
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:cbl="http://www.XC011I.com/schemas/XC011IInterface" 
         targetNamespace="http://www.XC011I.com/schemas/XC011IInterface">
  <complexType name="XMLA">
    <sequence>
      <element name="xmlb" type="cbl:xmla_xmlb"/>
    </sequence>
  </complexType>
  <complexType name="xmla_xmlb">
    <sequence>
      <element name="xmlc">
        <annotation>
          <appinfo source="http://www.wsadie.com/appinfo">
            <initialValue kind="SPACE"/>
          </appinfo>
        </annotation>
        <simpleType>
          <restriction base="string">
            <maxLength value="10"/>
          </restriction>
        </simpleType>
      </element>
    </sequence>
  </complexType>
  <element name="XMLA" type="cbl:XMLA"/>
</schema>


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)