To convert a business object to an XML document, the XML data handler loops through the attributes in the business object definition in sequential order. It generates XML recursively based on the order in which attributes appear in the business object and its children.
The XML data handler processes business objects into an XML document as follows:
The data handler generates XML for each attribute using the following rules:
Table 25. XML output for attributes that represent XML markup
XML entity business object attribute represents | XML output | Example | Application-specific information |
---|---|---|---|
Processing instruction
| <?AttrValue?> | <?xml version="1.0"?> | type=pi |
DTD
| <!AttrValue> |
<!DOCTYPE CUSTOMER "customer.dtd">
|
type=doctype
|
Element | <ElementName>... </ElementName> |
For XML document based on a DTD: <CUSTOMER>... </CUSTOMER> For XML document based on a
schema document:
|
type=pcdata
|
XML attribute | AttrName= "AttrValue" |
For XML document based on a DTD: Seqno="1" For XML document based on a
schema document:
|
type=attribute
|
CDATA section | <![CDATA[AttrValue]]> | <![CDATA [<HTML>Text</HTML>]]> |
type=cdata
|
Comment
| <!--CommentText --> | <!--Customer information from source application A--> |
type=comment
|
Schema location (with target namespace)
| <elementName xmlns="URI_path" xmlns:xsi= "http://www.w3.org/ 2001/XMLSchema- instance" xsi:schemaLocation= "URI_for_schema schema_location" ... | See Figure 26 |
type= xsischemalocation
|
Schema location (no target namespace)
| <elementName xmlns="URI_path" xmlns:xsi= "http://www.w3.org/ 2001/XMLSchema- instance" xsi:noNamespace SchemaLocation= "schema_location" ... | <order xmlns="http://sampleDoc.org.ord"
xmlns:xsi="http://www.w3.org/2001/ XMLSchema-instance" xsi:noNamespaceSchemaLocation= "order.xsd"> ... /<order> |
type=xsinoNSlocation
|
Table 26. Special characters and the XML representations
Special character | XML escape sequences |
---|---|
ampersand (&) | & |
less than (<) | < |
greater than (>) | > |
single quote (') | &apos |
double quote (") | " |
No XML is generated for these attributes.