Specifying PCDATA in Data Files: Difference between revisions
New page: {{context|Kit Reference|Conventions Used in Reference Section}} Numerous elements throughout the various XML files utilize the PCDATA block of the element to hold important information. P... |
No edit summary |
||
Line 5: | Line 5: | ||
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. | 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 | 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. | ||
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. | 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. |
Revision as of 09:18, 23 November 2008
Context: HL Kit … Kit Reference … Conventions Used in Reference Section
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.