CMarkup GetData Method
GetData method returns the string data value of the main position element or node. It returns an empty string if there is no data value, or there is no current position, or the main position element contains child elements.
Combined text data value
The text data in an element may be in a CData Section in which case
GetData returns the content of the CDATA section.
GetData concatenates any combination of text and CDATA Section nodes in the content of the element, discarding any XML comments and processing instructions. As described for the SetData method, consecutive CDATA Sections in the content of the main position element will be concatenated and returned by
GetData as one data string. This supports rare cases in which CDATA Sections are split to store data containing the
]]> end delimiter. The SetData method splits the data after the second bracket, other XML tools may place the end delimiter as a text node between the CDATA Sections. In both of the following EQUATION element examples,
Other node types
If the main position is at a node other than an element,
GetData returns the "data" portion of the node:
|Comment||the text between the double dashes|
|Processing Instruction||the text between the question marks, including the target|
|Document Type||the entire DTD including the beginning < and ending >|
|CDATA Section||the text between the inner brackets|
|Text||the text between tags|
|Whitespace||the whitespace text between tags|
See the Node Methods in CMarkup.