Create an XML Layout from a DTD or Schema

About this task

When you create a new map, you can either manually create an XML layout or you can use a wizard that creates a layout for you based on a DTD or schema.

The wizard performs the following tasks:

  • Raises a warning if it encounters attributes that use entities or notations
  • Changes attributes of type ENTITY or ENTITIES to type CDATA
  • Changes attributes of type NOTATION to type ENUMERATED
  • Disregards comments and processing instructions
  • Discards external entities and notations
  • Does not support XML namespaces for DTDs or conditional sections
  • Supports internal and external parameter entities
  • Supports external parameter entities that reference a URL only if Microsoft® Internet Explorer 3.0 or later is installed on the computer

To create an XML layout from a DTD or schema:

Procedure

  1. From the File menu, select New.
  2. In the New Map Wizard, complete the questions on the first screen.
    Note: To use XML schemas, the map type must be Sterling B2B Integrator.
  3. If you are translating from XML, from the Create a new data format using this syntax list, select XML and click Customize. If you are translating from another format, select that format and continue to the next screen.
  4. In the New XML Wizard, select the Customization File Type—the type of file you want to use to create your XML layout, either DTD or XML schema.
  5. Type the name of the DTD or XML schema, type the URL, or browse to the location of the DTD or XML schema, and click Next.
  6. Select the root element.

    The DTD or schema does not explicitly define the root element, so you can select from all the elements defined in the DTD or all the top-level elements defined in the .XSD schema (elements subordinate to the schema element). By default, the wizard selects the first element it encounters.

  7. Specify the maximum length for data elements.

    For a DTD, you can specify the maximum length of data elements because length is not defined in the DTD and is optional for elements declared in the XML schema. For an XML schema, the maximum length can be specified for some elements. You can specify a default field length for elements that do not have a specified field length.

  8. If you want the map to contain code lists equivalent to the enumerations defined in the DTD or schema, select the Build code lists for enumerated attributes check box.
    Note: The default for the Build code lists for enumerated attributes check box is cleared because using code lists may be redundant and thus your map is smaller and more efficient without them.
  9. Click Next.
  10. If you chose to import an XML schema, select the subelements you want to be included in the map, and click Next.
    Note: The list displays the entire tree of elements and subelements for the root element you selected, hierarchically displayed using indentation. Attributes are not included in this list.

    The default is that all elements and subelements are selected. When you clear the box next to an element, all its subelements are automatically cleared. Similarly, when you select the box next to a child element, its parent elements are automatically selected.

    Selecting only the elements and subelements you need for your map reduces the size of the map and makes it more efficient.
  11. If you are translating to XML, on the Output screen (from the Create a new data format using this syntax list), select XML and click Customize.
  12. In the New XML Wizard, select the Customization File Type—the type of file you want to use to create your XML layout, either DTD or XML schema.
  13. Type the name of the DTD or XML schema, type the URL, or browse to the location of the DTD or XML schema, and click Next.
    Note: When using the file:// protocol to reference a DTD, if you are unsure of your FTP connection (host name and FTP or Internet access) and the DTD is on the Sterling B2B Integrator server, provide an absolute path in the reference by omitting the host name and leaving the following slash. For example, file://home/sterling/dtd/test.dtd. If you are sure of your FTP connection, then you can specify a host name.

    If you are using an XML schema and the XML parser detects any errors, the messages are displayed in an error window.

  14. Select the root element.

    The DTD or schema does not explicitly define the root element, so you can select from all the elements defined in the DTD or all the top-level elements defined in the .XSD schema (elements subordinate to the schema element). By default, the wizard selects the first element it encounters.

  15. Specify the maximum length for data elements.

    For a DTD, you can specify the maximum length of data elements because length is not defined in the DTD and is optional for elements declared in the XML schema. For an XML schema, the maximum length can be specified for some elements. You can specify a default field length for elements that do not have a specified field length.

  16. If you want the map to contain code lists equivalent to the enumerations defined in the DTD or schema, select the Build code lists for enumerated attributes check box.
    Note: The default for the Build code lists for enumerated attributes check box is cleared because using code lists may be redundant and thus your map is smaller and more efficient without them.
  17. Click Next.
  18. If you chose to import an XML schema, select the subelements you want to be included in the map, and click Next.
    Note: The list displays the entire tree of elements and subelements for the root element you selected, hierarchically displayed using indentation. Attributes are not included in this list.

    The default is that all elements and subelements are selected. When you clear the box next to an element, all its subelements are automatically cleared. Similarly, when you select the box next to a child element, its parent elements are automatically selected.

    Selecting only the elements and subelements you need for your map reduces the size of the map and makes it more efficient.
  19. Click Finish.

    The XML Load Warnings dialog box opens if there are any errors. If the Sterling B2B Integrator Map Editor made changes to the DTD to make it compliant with Sterling B2B Integrator, it indicates the changes. Click OK.

  20. Continue with the New Map Wizard as directed. When you click Finish, the Sterling B2B Integrator Map Editor displays the new map in the Sterling B2B Integrator Map Editor window.

    The following figure shows an example of an XML document:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <services>
       <service name="BPMetaDataInfoService" activestatus="1" systemservice="1"/>
    </services>