To configure an XML data handler, you must ensure that its configuration information is provided in the XML data handler's child meta-object.
For the XML data handler, IBM delivers the default child meta-object
MO_DataHandler_DefaultXMLConfig. Each attribute in this
meta-object defines a configuration property for the XML data handler. Table 12 describes the attributes in this child meta-object.
Table 12. Child meta-object attributes for the XML data handler
Attribute name | Description | Delivered default value |
---|---|---|
BOPrefix | Prefix used by the default NameHandler class to build the names of business object names. The default value must be changed to match the name of the associated the business object definition. The attribute value is case-sensitive. | XMLTEST |
ClassName
| Name of the data-handler class to load for use with the specified MIME type. The top-level data-handler meta-object has an attribute whose name matches the specified MIME type and whose type is the XML child meta-object (described by Table 12). | com.crossworlds. DataHandlers. text.xml |
DefaultEscapeBehavior | If an attribute value contains special characters, it requires the XML data handler to perform escape processing. If the attribute's application-specific information does not include the escape tag, the XML data handler checks the value of the DefaultEscapeBehavior property to determine whether to perform escape processing. For more information, see For an XML element or attribute that contains special characters. | true |
DTDPath | Used by the data handler to configure the path to the document type definitions (DTDs). | None |
DummyKey | Key attribute; not used by the data handler but required by the business integration system. | 1 |
EntityResolver | Name of the class to use to handle references to external entities such as a DTD or schema. For more information on values for this attribute, see Entity resolver. | None |
IgnoreUndefinedAttributes | When this attribute is set to false, the XML data handler validates all XML attributes against the business object definition; it throws an exception when it encounters an undefined attribute. When this attribute is set to true, the XML data handler ignores all undefined XML attributes, generating a warning. | true |
IgnoreUndefinedElements | When this attribute is set to false, the XML data handler validates all XML elements against the business object definition; it throws an exception when it encounters an element not defined in the application-specific information. When this attribute is set to true, the XML data handler ignores all undefined XML elements (and any attributes within these undefined elements), generating a warning. | false |
InitialBufferSize | Defines the initial size of the buffer that is used when converting business objects to XML. Set this value to the size, in bytes, of your XML business objects. Setting this value to a high number will speed the conversion of business objects to serialized XML. | 2 MB (2,097,152 KB) |
NameHandlerClass | Name of the class to use to determine the name of a business object from the content of an XML document. Change the default value of this attribute if you create your own custom name handler. For more information, see Building a custom XML name handler. | com. crossworlds. DataHandlers.xml. TopElementNameHandler |
Parser | Package name of a SAX-compliant parser for the XML document. | None |
UseNewLine | Set to true if you want each tag in the output XML to be on a new line. (The XML data handler adds extra content in the form of line feeds and carriage returns to the XML document.) Set to false if you do not want to alter the XML output. | false |
Validation |
This value is used by the data handler to specify that the validating parser is used. The data handler does this by setting the feature http://xml.org/sax/features/validation of the xerces parser to true. To use a validating parser, the default value must be changed to true. When Validation is set to true, the XML parser will validate the XML document against:
| false |
ObjectEventId | Placeholder not used by the data handler but required by the business integration system. | None |
The "Delivered default value" column in Table 12 lists the value in the Default Value property for the corresponding attribute in the delivered business object. You must examine your environment and set the Default Value properties of those attributes to the appropriate values. You must make sure that at least the ClassName and BOPrefix attributes have default values.
A single child meta-object can be used by different MIME type/ subtype combinations if each of the combinations uses the same XML data handler configuration. If your connector requires different XML data handler configurations for different MIME types, then you must create a separate child meta-object for each data handler instance. To prepare multiple configurations of the XML data handler, take the following steps:
Create attributes in the top-level data-handler meta-object for each MIME type/subtype combination. For example, in support of the XML and SGML, you can create the following MIME types: text_xml and text_xml_sgml. Each of these attributes would represent its associated child meta-object.
You can also configure the XML data handler to support multiple instances of the same data handler. In this case, you can create another top-level attribute named text_xml_subtype, where subtype can be an application name, as in text_xml_AppA, an application entity name, or another appropriate name.
For more information about how to configure a data handler, see Configuring data handlers.
Figure 12 shows an example of a top-level data-handler meta-object and its corresponding child meta-objects. Notice that there are four attributes in the top-level meta-object MO_DataHandler_XMLSample, but only three child meta-objects. This is because the attribute Application_xml_AppC uses the same child meta-object as the attribute text_xml_AppB to invoke the appropriate data handler.
Figure 12. Example meta-object for multiple XML data handlers