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. As of GoldSim 14, the XML also includes the definitions of all Data elements. It does not, however, include the definiton (e.g., input values, units) for any other elements besides the Data element type.
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 Data element C is a vector type with 3 items called Zone10, Zone20, and Zone30.
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. Note values are displayed only for the Data elements.
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.
Comments
0 comments
Please sign in to leave a comment.