Insert an Element from a Schema or DTD
About this task
The Insert Element from Schema or DTD function enables you to add an element from a schema or DTD.
To insert an element from a schema or DTD:
Procedure
- Right-click the XML map component after which you want to insert the element and select Insert > Element from schema/dtd, or if you want the element to be the first element in the XML file format, right-click the XML File icon and select Create Sub > Element from schema/dtd.
- From the Customization File Type list, select whether the element will be copied from a DTD or schema.
- In the File Location box, type the file path and name of the DTD or schema or click Browse and select the file (then click Open).
- Click Next.
- Follow the instructions on the next wizard page and click Next.
- If you chose to insert the element from a schema, you are prompted with another wizard page. Follow the instructions on that wizard page and click Next.
- Click Finish to insert
the element into your XML file format. The Sterling B2B Integrator
Map Editor displays
the XML Element Properties dialog box so you can configure the element
properties.
If the inserted element is an abstract one, the displayed XML Element Properties dialog box enables you to provide a concrete element to replace the abstract one, by clearing the Defined as Abstract check box on the Tag tab (you must replace abstract elements with concrete elements by clearing this check box to avoid map compilation errors or, optionally, you can avoid the compilation errors by deactivating the abstract elements).
- In the Name tab, specify
the description (if applicable).
Note: The Additional notes box is populated automatically with the XML element annotation when you import an XML schema.
- If necessary, click the Tag tab
and change the value in the Tag box.
Note: This value must match the element in the XML document. XML tags cannot contain spaces.
- If the element is an abstract type, select
the Tag tab and clear the Defined as abstract check
box. By clearing this check box, you change the abstract element to
a concrete one. This check box must be cleared to enable the map to
compile successfully (without compilation errors).
Note: Optionally, you can avoid compilation errors from abstract elements by deactivating the abstract elements. For more information about deactivating map components, see Activate Map Components.
- Select the Repeating tab to access the occurrence options.
- Select either the Conditional or Mandatory option to specify whether the element is required in the map.
- Select the appropriate repeating option for the element.
- If you must specify the number of times the element can repeat (loop), type that number in the Maximum usage box.
- Did you specify that the element repeats
(loops)?
- If Yes, continue with step 11.
- If No, continue with step 12.
- Do you want to specify an extended rule for
this element?
- If Yes, click the Loop Extended Rules tab,
define the rule, and continue with step 12.
For more information about extended rules, see Using Extended Rules.
- If No, continue with step 12.
- If Yes, click the Loop Extended Rules tab,
define the rule, and continue with step 12.
- Click OK. The Sterling B2B Integrator Map Editor saves the element and closes the XML Element Properties dialog box.