Specifying PCDATA in Data Files: Difference between revisions

From HLKitWiki
Jump to navigationJump to search
No edit summary
No edit summary
 
Line 1: Line 1:
{{context|Kit Reference|Conventions Used in Reference Section}}
{{context|Kit 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.
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.

Latest revision as of 05:10, 4 December 2008

Context: HL Kit &#133; Kit 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.