The XMLReader library provides models and functions for extracting data from XML files. Real and String scalars and matrices can be extracted and used to set model parameters.
Reading parameters from an XML provides a way to log the setup of a model and allows for easy modification of model parameters. Efficient batch simulation is supported as the model does not have to be recompiled to read any changes in the XML file, any XML changes will be read during initialisation of the model.
To read a value from the XML document and return it as a real scalar in Modelica, the user simply calls a function called readReal that exists within the Document model that has been added to the system model. This readReal function is used to set parameters to be equal to the values in an XML file.
Other functions are supplied for extracting String values and for extracting Real and String matrices. A number of different matrix formats are supported including delimited matrices and the Matlab&Reg; matrix syntax and more.
Matrices can also be read into .mat files for efficient use in the Table blocks.
Each model requires an XML document that defines what XML file is to be read and the format of the XML file. A wizard is supplied that helps generate the document model that describes the format used in the XML file.
This wizard searches through the XML document and finds the possible formats where componentName is a component and parameterName is a parameter and allows the user to select which of these formats is the desired format.