Previous Topic Next topic Print topic


FILLER data items

Unnamed data description entries, referred to as FILLER data items in this section, may be used to generate XML text without starting a new XML element name. Specifying named and unnamed elementary data items subordinate to a named group generates XML mixed content for an element named by the group name.

Numeric FILLER data items will not reliably produce well-formed XML sequences. For this reason, FILLER data items should always be nonnumeric PIC X or PIC A.

For example, the following COBOL sequence:
 01 A.
 02 FILLER Value "ABC".
 02 B Pic X(5) Value "DEF".
 02 FILLER Value "GHI".
generates the following well-formed XML sequence:
 <a>ABC<b>DEF</b>GHI</a>

FILLER data items, however, are treated differently than named data. All leading and/or trailing spaces are preserved, so that the length of the data is the same as the COBOL data length. For more information, see Handling Spaces and Whitespace in XML.

In addition, the data is treated as PCDATA; that is, embedded XML special characters are preserved. This allows short XHTML sequences, such as "break" to be represented as FILLER (for example, <br/>). XHTML (eXtensible HyperText Markup Language) is based on HTML 4, but with restrictions such that an XHTML document is also a well-formed XML document. For example, the following COBOL sequence:
 01 A.
 02 FILLER Value "<br />".
 02 B Pic X(5) Value "DEF".
 02 FILLER Value "GHI".
generates the following well-formed XML sequence:
<a><br /><b>DEF</b>GHI</a>
	 
Care must be taken in placing XML special characters in FILLER data items, since the resultant XML sequence might not be well-formed. For example, the following COBOL sequence:
01 A.
 02 FILLER Value "<br".
 02 B Pic X(5) Value "DEF".
 02 FILLER Value "GHI".
generates the following syntactically malformed XML sequence:
 <a><br<b>DEF</b>GHI</a>
	 

Whenever FILLER data items are present in a data item that is referenced by the XML EXPORT statements, the resulting document is checked to ensure that the resultant XML document is well-formed. When the document is not well-formed, an appropriate status value is returned to the COBOL program.

Previous Topic Next topic Print topic