Specifying PCDATA in Data Files

From HLKitWiki
Revision as of 22:10, 3 December 2008 by Rob (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Context: HL KitKit Reference 

Numerous elements throughout the various XML files utilize the PCDATA block of the element to hold important information. PCDATA blocks, in conjunction with the "<[CDATA[" section, make it possible to easily enter lengthy text that does not need to worry about the various XML restrictions on certain characters used in the text.

To simplify the documentation, the use of PCDATA within an element will not be handled separately. Instead, any element that uses PCDATA will simply have an attribute listed with the name "PCDATA". The description for this attribute will apply to the use of the PCDATA block within the element.

One characteristic of PCDATA is that it can optionally preserve or collapse all use of whitespace characters within the block. Whitespace characters include spaces, tabs, and newlines. When whitespace is collapsed, text that runs across multiple lines is merged together into a single flow, which is ideal when you're writing paragraphs of information, such as release notes. However, there are many times when it is critical that whitespace be preserved, such as with scripts that require each statement to be on a separate line.

When a PCDATA block is used as a script, the attribute type will be designated as "Script" to distinguish it from the normal "Text" type. By default, whitespace will be preserved for scripts and collapsed for all other situations. Any exceptions to this behavior will be clearly specified within the description for the PCDATA attribute.