You can create a simple XML file that can be viewed in a text editor, browser or XML editor that echoes out all of the elements in a GoldSim model. This file contains the name, type, description and path for each element, and specifically illustrates the model hierarchy. It does not, however, include the definiton (e.g., input values, units) for any elements.
You can create this file by selecting File | Save Inventory… from the main menu.
XML files can be formatted by editing the file and specifying a stylesheet (when the XML file is created by Goldsim, no stylesheet is specified). This allows the files to appear much more readable.
You can specify a stylesheet by editing the XML file (e.g., in a text editor) and adding the following line shown in bold (below the first line which is present by default):
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<?xml-stylesheet type="text/xsl" href="Containment.xslt"?>
In this example, Containment.xslt is the name of the stylesheet.
In this article we provide two stylesheets that you can use. To understand what these stylesheets do, let's consider a very simple model file (as illustrated in the browser):
As can be seen, in this model, Container1 contains a Data element named A, an Expression element named B, and a Container named Container2. Container2, in turn, contains a Data element named C.
The XML Model Inventory file can be viewed in most browsers, and by default (i.e., in the absence of a stylesheet) the XML file for this model will look similar to this (this is viewed using Internet Explorer):
If we use the stylesheet Containment.xlst, the XML file looks like this (in Internet Explorer):
As can be seen, this stylesheet formats the XML file emphasizing the containment hierarchy.
If we use the stylesheet Class.xlst, the XML file looks like this (in Internet Explorer):
As can be seen, this stylesheet formats the XML file by element type.