6XML Integration Objects and the DTD Wizard
XML Integration Objects and the DTD Wizard
This chapter discusses the DTD wizard and how it creates XML integration objects. It includes the following topics:
Creating XML Integration Objects with the DTD Wizard
Siebel EAI provides two different wizards to create XML integration objects. An XML integration object is essentially an integration object with a base object type of XML. This wizard parses an external Document Type Definition (DTD) file to create an XML integration object.
To create an integration object
Select File, then New Object.
Select the EAI tab.
Double-click the Integration Object icon.
Complete the Integration Object Builder initial page:
Select the project from the first drop-down list.
Select EAI DTD Wizard as the Business Service.
Navigate to the path to the location of the DTD or XML file that you want to use as the basis of the DTD and click Next.
Note: The Simplify Integration Object Hierarchy option creates a simpler and flatter internal representation of the XML integration object. Please note that this does not change the external representation. Having a simpler internal representation makes declarative data mapping easier.
Select the source object and give it a unique name, and then click Next.
Click on the plus sign to expand the list and select or clear the fields based on your business requirements.
Click Next to go to the final page to review messages generated during this process and take necessary action.
Click Finish to complete the process.
The integration object is displayed in the Integration Objects list.
Selecting the Source Object in the DTD Wizard
Each XML document has exactly one root or document element. The root element corresponds to the integration object. However, because an XSD or DTD file can be used by a vendor to specify the XML documents that it can generate, the root element cannot be inferred from the XSD or DTD file. For example, Ariba can generate XML for contracts, order requests, and subscriptions. A single file describes the possible XML documents.
As a reference when determining the root element, use an XML document that best represents the XML documents you are integrating. The root element is the root of the XML hierarchy tree. No part of the root element appears within the content of any other element. For all other elements, the <Start></Start> tag appears within the content of another element.
To view any XML hierarchy, with collapsible and expandable elements, use an XML editor, an XML reader, or an XML-capable browser such as Microsoft Internet Explorer.
How the DTD Wizard Creates XML Integration Objects
XML integration objects consist of the following:
Elements
Generally, XML elements map to components within integration objects. However, in many cases the component is so simple that it is a performance optimization to map these elements into component fields of the parent element rather than as child components.
Elements are expressed this way (within brackets and starting with an exclamation point):
<!ELEMENT car (year, model, color+)>
An element can be mapped to a component field when the following three properties are satisfied:
The component field must match an element within the DTD.
The component field must match the cardinality of the element in the DTD; in other words, if the DTD specifies only one instance of this element type is valid, all subsequent appearances of this element type are illegal.
The element must appear within the root element; any element appearing outside of the root is illegal.
When an element is mapped to component field, the component field has the property XML Style set to Element.
Attributes
Attributes include additional information related to an element, can be either required or implied (optional), and might have a default value. For example, an element might be a car with soundsystem, transmission, and doors as attributes. Soundsystem can be any text and is required; transmission is required because there is a default listed; other is optional.This would be expressed this way:
<!ELEMENT car> <!ATTLLST car soundsystem CDATA #REQUIRED transmission (automatic | manual | 5-speed-manual) "automatic" other CDATA #IMPLIED>
Attributes are always mapped to component fields and are related directly to elements. The component field within Siebel application has the XML Style property set to Attribute.
Element’s #PCDATA
If the element is mapped to an integration component, then its #PCDATA is mapped to a component field <!Element> #PCDATA
. If the element is mapped to a field, then the #PCDATA
is mapped to the value of the field.
Names
Name is the name of the component or the field of the integration object. Because these names have to be unique within an integration object, the names might have suffixes attached to make them unique.
Property External Name is the name of the attribute or the element in the external system, such as CustName.
Property XML Tag is the name of the tag in the XML, such as <customer>.
Hierarchy
The parent components of integration components in an integration object correspond to their parents in XML. For integration component fields, if the property XML Parent Field is set, then the field in the same component with its Name value equal to the XML Parent Field corresponds to the parent in the XML. This happens because elements can be mapped to fields of integration components.
For integration component fields, if the property XML Parent Field is not set, then the parent component corresponds to the parent in the XML.
Connectors
Connectors specify the order of elements and either/or relationships, if one exists, as shown in the following.
Table Connectors
Connector | Explanation | Example |
---|---|---|
, |
followed by |
(a,b) |
| |
one or the other |
(a | b) |
Cardinality
As shown in the following, the DTD syntax allows you to specify a cardinality (the number of times an element can appear within an XML document) for elements using the following modifiers: question mark (?), plus sign (+), and asterisk (*), or none. Elements with a cardinality, or occurrence, specified in a DTD map only to Integration Components. The Cardinality property in the Integration Component within Siebel maps to the specified cardinality information in the DTD.
Table Rules for Mapping for Cardinality Within a DTD
DTD Element Occurrence Operator | Description | Integration Component Cardinality Property | Description |
---|---|---|---|
None |
Appears once |
Not applicable |
Not applicable |
? |
Appears 0 or once |
Zero or One |
Appears 0 or once |
+ |
Appears one or more times |
One or More |
Appears one or more times |
* |
Can appear 0 or more times |
Zero or More |
Can appear 0 or more times |
No modifier |
Appears once |
One |
Appears once |
The specification for DTDs supports using parentheses to express complex hierarchical structures. For example:
<!ELEMENT rating ((tutorial | reference)*, overall)+ >
The DTD Wizard uses the operator (?, *, +, or "none") closest to the child element as that child element’s cardinality. In addition, the DTD Wizard will ignore such grouping by parentheses as illustrated in the preceding example.