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: TMatrix, TIntMatrix, TMat3D
Declaration: procedure WriteToOpenXMLFile (var OutFile : TextFile; CreateHeader: boolean; DataID: string);

The method WriteToOpenXMLFile writes the contents of the 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 (2 for TMatrix and TIntMatrix, 3 for TMat3D)
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 planes in a 3D matrix (only used in class TMat3D)

example:

<numplanes>3</numplanes>
<cell > cell contents

ix                   column index of the cell
iy                   row index of the cell
iz                   plane index of the cell (class TMat3D only)

example:

<cell ix="2" iy="3">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