If your XML data contains one or more special characters, you must add a CDATA format tag to your data element. The following table lists the special characters that require the use of a CDATA tag.
Special character |
Special meaning |
Entity encoding |
|---|---|---|
< |
Begins a tag |
< |
> |
Ends a tag |
> |
" |
Quotation mark |
" |
' |
Apostrophe |
' |
& |
Ampersand |
& |
The MSXML parser requires a CDATA format tag when you use one of these characters. The following example demonstrates the use of a CDATA format tag:
<VENDNAME>
<![CDATA[Consolidated Telephone & Telegraph]]>
</VENDNAME>
You can also use a CDATA tag to remove data from a field. To clear data from a field, create an eConnect XML document that updates the targeted record. Use a CDATA tag that contains a blank space to populate the eConnect element that represents the field.
The following example uses a CDATA tag to clear the Short Name field of a customer. Notice how the CDATA tag contains a single blank space.
<eConnect xmlns:dt="urn:schemas-microsoft-com:datatypes">
<RMCustomerMasterType>
<eConnectProcessInfo>
</eConnectProcessInfo>
<taUpdateCreateCustomerRcd>
<CUSTNMBR>AARONFIT0001</CUSTNMBR>
<SHRTNAME>
<![CDATA[ ]]>
</SHRTNAME>
<UpdateIfExists>1</UpdateIfExists>
</taUpdateCreateCustomerRcd>
</RMCustomerMasterType>
</eConnect>