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_matrix
Class: TMat4D
Declaration: procedure WriteToOpenXMLFile (var OutFile: TextFile; CreateHeader: boolean; DataID: string);

The method WriteToOpenXMLFile writes the contents of the hypercube matrix 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 matrix 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 <matrix> tag. If the parameter DataID is empty, the value of the property DataID is used instead of an empty string.

WriteToOpenXMLFile generates the following tags:

XML Tag Description
<matrix> the root element of the matrix. It contains the following attributes:

sig       signature; is always "SDLCSuite"
vers     version string
dim       dimension of the matrix (always 4 for TMat4D)
id         name of matrix as defined by the parameter DataID

example:

 <matrix sig="SDLCSuite" vers="1.0" dim="2" id="Testmatrix">
<numcols> specifies the number of columns

example:

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

example:

<numrows>13</numrows>
<numplanes> specifies the number of layers in a 4D hypercube matrix

example:

<numplanes>3</numplanes>
<numtimeslots> specifies the number of timeslots in a 4D hypercube matrix

example:

<numtimeslots>5</numtimeslots>
<cell > cell contents

ix     column index of the cell
iy     row index of the cell
il     layer index of the cell
it     time slot index of the cell

example:

<cell ix="2" iy="3" il="1" it="4">17.332</cell>

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

Hint 2: WriteToOpenXMLFile stores only non-zero values in the file. This makes the XML file considerably shorter for matrices containing many zero elements.



Last Update: 2023-Feb-06