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


Class:TMatrix, TIntMatrix, TMat3D
Declaration: procedure SaveAsXMLFile (FName: string; DataID: string);

The method SaveAsXMLFile stores the contents of the 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: SaveAsXMLFile stores only non-zero values in the file. This makes the XML file considerably shorter for matrices containing many zero elements.

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="2" id="TestMatrix"> 
<cell ix="1" iy="1">1.22</cell> 
<cell ix="3" iy="1">2.135882</cell> 
<cell ix="1" iy="2">2</cell> 
<cell ix="3" iy="2">5</cell> 
<cell ix="1" iy="3">3</cell> 
<cell ix="3" iy="3">123.3</cell> 
<cell ix="4" iy="3">1.2301E12</cell> 
<cell ix="1" iy="5">5</cell> 

Last Update: 2023-Feb-06