Software documentation

Development tools

Code Structure

Techniques and Standards

How To

Functional Info

Background Info

JMRI: XML Usage

JMRI uses XML for a number of purposes: to hold decoder definitions, for its persistance system for configuration and panel information, and to create parts of the web site from other files. This page describes some aspects of this.

File Format Definitions

Starting with JMRI 2.9.4 file formats are specified by XML Schema. Those XML Schema are described on a separate page.

Prior to that, DTDs were used. Reading those older files is still supported.

Those schema and DTDs need to be available to the program when it reads the files, as they define the default values of missing attributes and other needed information.

In the JMRI distributions, these are stored in the xml/schema and xml/DTD directories.

JMRI writes all files to reference schema using URLs such as "http://jmri.org/xml/schema/layout-2-9-6.xsd". When read by the program this will automatically be handled properly by a custom resolver. When read by e.g. a web browser, the browser can get the schema from the main JMRI web servers when needed. For more information on how JMRI uses XML Schema, particularly how we control and version changes, see our page on XML Schema usage and associated set of examples.

The DTDs were located from DOCTYPE definition statements in the XML files. For historical reasons, these can be in several formats. The complicated set of rules for mapping those to a directory location is described on a separate page.

Other Information

JMRI XML files can generally be formatted and viewed in web browsers. We control the formatting using XSLT transforms. The process is described on a separate page.

XML files can be edited with a text editor, but a dedicated editor can help a lot. We provide a list of editors, along with a few comments on each.