JMRI: Viewing XML Files
JMRI stores various information in XML files. Although they're a text format that is basically human-readable, it's a complicated, structured format.
To make this information easier to read, print and understand, most JMRI XML files can be displayed in a web browser. A technique called "XSLT stylesheets" is used to format them within the web browser. For an example of how this looks, please see the sample panel XML file on the main JMRI web site. (May take a few seconds to load)
To view an XML file that JMRI has created, just open the file with your favorite web browser. In many cases, you should be able to just double-click on it, or drag it to the web browser's icon. On some platforms, you'll need to open it from the "File" menu.
Unfortunately, this simple approach doesn't always work, because not all browsers properly implement the algorithms for finding the formatting files that are needed for this display. If the first browser you try doesn't display the XML file (usually just showing a blank page, though sometimes they'll display an error message), please try other ones you've got installed. Internet Explorer is particularly problematic. Mozilla, Safari and Opera seem to get this right, while Firefox seems to work properly on some platforms and not on others. (There might also be options that affect whether it works. Here's some technical background)
If none of the browsers available to you can display the file, you can get around this problem using the JMRI mini web server in JMRI version 2.9.4 and later.
To do this:
- First, start JMRI:
- Either DecoderPro or PanelPro can be used, and no layout connection is needed.
- You do need to be using JMRI 2.9.4 or later.
- The file you want to view must have been stored from JMRI 2.9.4 or later. If it's older than that, just load it into JMIR 2.9.4 or later and store it again.
- Start the JMRI Web Server: from the Tools menu, select "Start JMRI Web Server".
- Open your web browser and enter the URL "http://localhost:12080"
- You should now see the JMRI web page for your layout, like the
If the XML file you wish to view is within the JMRI distribution directory, click on the "/dist" link at bottom right. If it's within the preferences directory, click on the "/prefs" link.
- Finally, click on any needed directory names to get to your file, then click on your file.
You can then use your browser to view, print, save, etc. as desired.