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....



SaveAsXMLFile


Unit: SDL_matrix
Class: TMat4D
Declaration: procedure SaveAsXMLFile (FName: string; DataID: string);

The method SaveAsXMLFile stores the contents of the hypercube matrix as an XML file on the disk. The parameter FName specifies the name of the file to be generated, 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. For a detailed description of the generated tags please see the method WriteToOpenXMLFile.

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

Hint 2: Due to the text format, access to data stored as XML files is much slower than access to binary data files. For this reason SaveAsXMLFile should be used only for small matrices or for archiving purposes. Storing hypercube matrices within applications should use SaveBinary, instead of SaveAsXMLFile.

Example: Following is a sample XML code generated by SaveAsXMLFile. The parameter DataID has been set to 'TestMatrix':

<?xml version="1.0"?>
<!-- TMatrix / SDL Component Suite -->
<matrix sig="SDLCSuite" vers="1.0" dim="4" id="Test Matrix">
<numcols>4</numcols>
<numrows>13</numrows>
<numplanes>2</numplanes>
<numtimeslots>4</numtimeslots>
<cell ix="1" iy="1" il="1" it="1">1.22</cell>
<cell ix="3" iy="1" il="1" it="1">2.135882</cell>
<cell ix="1" iy="2" il="1" it="1">2</cell>
<cell ix="3" iy="2" il="1" it="1">5</cell>
<cell ix="1" iy="3" il="1" it="4">3</cell>
<cell ix="3" iy="3" il="1" it="4">123.3</cell>
<cell ix="4" iy="3" il="2" it="4">1.2301E12</cell>
<cell ix="1" iy="5" il="2" it="4">63115</cell>
<cell ix="2" iy="11" il="2" it="4">-45</cell>
<cell ix="1" iy="13" il="2" it="4">409.89999911</cell>
</matrix>



Last Update: 2012-Oct-20