Skip to content

Commit

Permalink
Merge pull request #207 from mantidproject/feature/8859_update_idf_pages
Browse files Browse the repository at this point in the history
Update IDF concept documentation. re #8859
  • Loading branch information
DanNixon committed Feb 13, 2015
2 parents 33d9643 + 8eb51d5 commit 809b619
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
21 changes: 11 additions & 10 deletions Code/Mantid/docs/source/concepts/Create_an_IDF.rst
Expand Up @@ -8,26 +8,27 @@ This page will help you get started with making an instrument definition file. F
Basic Steps
-----------

The best way to get started is to:
The recommended set of steps to get started is to:

- `Set up an editor for XML that uses schema validation <http://www.mantidproject.org/Using_XML_Schema>`__
- Read the :ref:`introduction to IDFs <InstrumentDefinitionFile>`
- Read the annotated existing IDFs
- Look for similar existing IDFs
- Use the IDF page for more detailed documentation
- Read the introduction section of :ref:`IDF <InstrumentDefinitionFile>`
- Study the annotated IDF examples at the bottom of this page
- Look for similar existing IDFs to the one you would like to create
- Use an editor, which is :ref:`XML schema aware <Using_XML_Schema>`
- Use the full :ref:`IDF <InstrumentDefinitionFile>` page for detailed documentation

The above are suggestive steps for generating an IDF. In addition there have
been created several scripts for automatic the creation of IDFs. Such scripts
can be found `here <https://github.com/mantidproject/mantidgeometry>`__.

Using the Schema
----------------

To set up your editor with the schema, `Follow These Instructions <http://www.mantidproject.org/Using_XML_Schema>`__.
To set up your editor with the schema, :ref:`Follow These Instructions <Using_XML_Schema>`.
The Schema can help with writing the IDF. For example:

- In Visual Studio the schema can be used to auto-insert elements and attributes permitted by the schema.
- In eclipse the IDF can be created in a design view by selected available elements and attributes without having to type the code yourself.

The IDF schema (IDFSchema.xsd) is located in your mantid install directory at MantidInstall\instrument\Schema. Note this folder also includes the schema, ParameterFileSchema.xsd, which may be used to assist in writting a :ref:`parameter file <InstrumentParameterFile>`


Find a Similar existing IDF
---------------------------

Expand Down
Expand Up @@ -17,7 +17,7 @@ Creating a Parameter File
Using a Schema
~~~~~~~~~~~~~~

To create a parameters file it is advisable to consult the parameter file schema, located in your mantid directory at mantid\code\instrument\Schema\ParameterFileSchema.xsd. Set up your editting program to validate your XML file against this schema following `these instructions <http://www.mantidproject.org/Using_XML_Schema>`__. Once set up, the schema can be used to find any errors in the structure of your parameter file and suggest auto-fill options to help write your parameter file.
To create a parameters file it is advisable to consult the parameter file schema, located in your mantid directory at mantid\code\instrument\Schema\ParameterFileSchema.xsd. Set up your editting program to validate your XML file against this schema following :ref:`these instructions <Using_XML_Schema>`. Once set up, the schema can be used to find any errors in the structure of your parameter file and suggest auto-fill options to help write your parameter file.

General Structure
~~~~~~~~~~~~~~~~~
Expand Down
30 changes: 30 additions & 0 deletions Code/Mantid/docs/source/concepts/Using_XML_Schema.rst
@@ -0,0 +1,30 @@
.. _Using_XML_Schema:

Using XML Schemas
=============

This page gives instructions on how to configure various editing programs for
writing XML with schema validation. This helps by finding errors in
XML structure, and displaying the list of elements and attributes allowed at
any point in the XML file. This will be useful for anyone creating an
Instrument Definition file (IDF) or Parameters file, or editing the Facilities file

XML Editors with Schema Validation tools
----------------------------------------
Examples of editors that include schema validation tools:

- `Visual Studio <http://www.visualstudio.com/en-us>`__
- `Eclipse <http://www.eclipse.org>`__
- `jEdit <http://www.jedit.org>`__
- `Altova <http://www.altova.com/xmlspy/xml-schema-editor.html>`__
- `Liquid Tehnologies <http://www.liquid-technologies.com/xml-schema-editor.aspx>`__
- `Stylusstudio <http://www.stylusstudio.com/open_xsd_validation.html>`__

Where an XML includes a link to an XML schema then simply open the XML file in
say Visual Studio and the editor will give you feedback if you for example are
missing attributes of an XML element that the Schema thinks should be there.

For example all :ref:`IDFs <InstrumentDefinitionFile>` shipped with Mantid
contain a link to the IDF Schema.

.. categories:: Concepts

0 comments on commit 809b619

Please sign in to comment.