Files
2026-06-17 14:00:51 +02:00

65 lines
2.9 KiB
Plaintext

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="generator" content="HTML Tidy for HTML5 for Apple macOS version 5.8.0">
<title>JMRI: XML Usage</title>
<meta name="author" content="Bob Jacobsen">
<meta name="keywords" content="JMRI technical code xml usage">
<!--#include virtual="/help/en/parts/Style.shtml" -->
</head>
<body>
<!--#include virtual="/help/en/parts/Header.shtml" -->
<div id="mBody">
<!--#include virtual="Sidebar.shtml" -->
<div id="mainContent">
<h1>JMRI: XML Usage</h1>
<p>JMRI uses XML for a number of purposes: to hold decoder definitions, for its <a href=
"XmlPersistance.shtml">persistance system</a> for configuration and panel information, and to
create parts of the website from other files. This page describes some aspects of this.</p>
<h2>File Format Definitions</h2>
<p>Starting with JMRI 2.9.4 file formats are specified by XML Schema. Those XML Schema are
described on a <a href="XmlSchema.shtml">separate page</a>.</p>
<p>Prior to that, DTDs were used. Reading those older files is still supported.</p>
<p>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.</p>
<p>In the JMRI distributions, these are stored in the <a href="/xml/schema">xml/schema</a>
and <a href="/xml/DTD">xml/DTD</a> directories.</p>
<p>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
<a href="XmlSchema.shtml">page on XML Schema usage</a> and <a href=
"XmlSchemaExamples.shtml">associated set of examples</a>.</p>
<p>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 <a href="XmlDtdUsage.shtml">separate page</a>.</p>
<h2>Other Information</h2>
<p>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 <a href=
"XmlView.shtml">separate page</a>.</p>
<p>XML files can be edited with a text editor, but a dedicated editor can help a lot. We
provide a <a href="XmlEditors.shtml">list of editors</a>, along with a few comments on
each.</p>
<!--#include virtual="/help/en/parts/Footer.shtml" -->
</div>
<!-- closes #mainContent-->
</div>
<!-- closes #mBody-->
<script src="/js/help.js"></script>
</body>
</html>