The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



WriteToOpenXMLFile


Unit:SDL_dstruct
Class: TStringArray
Declaration: procedure WriteToOpenXMLFile (var OutFile : TextFile; CreateHeader: boolean; DataID: string);

The method WriteToOpenXMLFile writes the contents of the string array to an open text file OutFile using XML syntax. If the parameter CreateHeader is TRUE a minimum XML header is generated. CreateHeader should be set to a FALSE value if the string array data is to be appended to an existing XML file. The parameter DataID holds a unique identifier which is stored as the attribute "id " of the <strarray> tag.

Please note that the data of the string array is stored using the current sort order (which may differ from the original one). Thus it is recommended to perform an UnSort before saving the data.

WriteToOpenXMLFile generates the following tags:

XML Tag Description
<strarray> the root element of the string array. It contains the following attributes:

sig       signature; is always "SDLCSuite"
vers     version string
id         name of string array as defined by the parameter DataID

example:

 <strarray sig="SDLCSuite" vers="1.0" id="mystrarray">
<numcols> specifies the number of columns

example:

<numcols>4</numcols>
<numrows> specifies the number of rows

example:

<numrows>13</numrows>
<cell > cell contents

ix                   column index of the cell
iy                   row index of the cell

example:

<cell ix="2" iy="3">Test Cell 2,3</cell>

Hint: For a sample XML file, see the description of the method SaveAsXMLFile.



Last Update: 2012-Oct-20