diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst
index dd404a0db0..bf6f93a3c7 100644
--- a/docs/source/usersguide/input.rst
+++ b/docs/source/usersguide/input.rst
@@ -57,13 +57,7 @@ Validating XML Files
Input files can be checked before executing OpenMC using the ``xml_validate``
script. It is located in ``src/utils/xml_validate.py`` in the source code or in
-``bin/xml_validate`` in the install directory. Before use, the third party
-package TRANG_ must be installed and in your ``PATH`` to convert the compact
-RelaxNG schema to standard RelaxNG format. For Ubuntu, you can install with:
-
-.. code-block:: bash
-
- sudo apt-get install trang
+``bin/xml_validate`` in the install directory.
Two command line arguments can be set when running ``xml_validate``:
@@ -84,7 +78,6 @@ Message Description
======================== ===================================
[XML ERROR] Cannot parse XML file.
[NO RELAXNG FOUND] No RelaxNG file found for XML file.
-[TRANG FAILED] TRANG not installed properly.
[NOT VALID] XML file does not match RelaxNG.
[VALID] XML file matches RelaxNG.
======================== ===================================
@@ -98,8 +91,6 @@ the following command:
/opt/openmc/0.6.2/bin/xml_validate
-.. _TRANG: http://www.thaiopensource.com/relaxng/trang.html
-
--------------------------------------
Settings Specification -- settings.xml
--------------------------------------
diff --git a/src/relaxng/cmfd.rng b/src/relaxng/cmfd.rng
new file mode 100644
index 0000000000..1060fcbf3e
--- /dev/null
+++ b/src/relaxng/cmfd.rng
@@ -0,0 +1,230 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/relaxng/cross_sections.rng b/src/relaxng/cross_sections.rng
new file mode 100644
index 0000000000..5e531e0132
--- /dev/null
+++ b/src/relaxng/cross_sections.rng
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+ 15
+
+
+
+
+ 15
+
+
+
+
+
+
+
+ 15
+
+
+
+
+ 15
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 255
+
+
+
+
+ 255
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ascii
+ binary
+
+
+
+
+ ascii
+ binary
+
+
+
+
+
+
+
+
+
+
+ 255
+
+
+
+
+
+ ascii
+ binary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/relaxng/geometry.rng b/src/relaxng/geometry.rng
new file mode 100644
index 0000000000..9ac3c9c598
--- /dev/null
+++ b/src/relaxng/geometry.rng
@@ -0,0 +1,345 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ void
+
+
+
+
+
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 15
+
+
+
+
+ 15
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ transmit
+ reflective
+ vacuum
+
+
+
+
+ transmit
+ reflective
+ vacuum
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/relaxng/materials.rng b/src/relaxng/materials.rng
new file mode 100644
index 0000000000..4c9496eae4
--- /dev/null
+++ b/src/relaxng/materials.rng
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10
+
+
+
+
+ 10
+
+
+
+
+
+
+
+
+
+
+
+ 7
+
+
+
+
+ 7
+
+
+
+
+
+
+
+ 3
+
+
+
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2
+
+
+
+
+ 2
+
+
+
+
+
+
+
+ 3
+
+
+
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 7
+
+
+
+
+ 7
+
+
+
+
+
+
+
+ 3
+
+
+
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+
+
+
+
+
diff --git a/src/relaxng/plots.rng b/src/relaxng/plots.rng
new file mode 100644
index 0000000000..a21f4d141e
--- /dev/null
+++ b/src/relaxng/plots.rng
@@ -0,0 +1,295 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 50
+
+
+
+
+ 50
+
+
+
+
+
+
+
+
+ slice
+ voxel
+
+
+
+
+ slice
+ voxel
+
+
+
+
+
+
+
+
+ cell
+ mat
+ material
+
+
+
+
+ cell
+ mat
+ material
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ xy
+ yz
+ xz
+
+
+
+
+ xy
+ yz
+ xz
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tally
+ entropy
+ ufs
+ cmfd
+
+
+
+
+ tally
+ entropy
+ ufs
+ cmfd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/relaxng/readme.rst b/src/relaxng/readme.rst
new file mode 100644
index 0000000000..9660e3f8ce
--- /dev/null
+++ b/src/relaxng/readme.rst
@@ -0,0 +1,19 @@
+=====================
+Editing RelaxNG files
+=====================
+
+All direct edits to RelaxNG files should be in the .rnc files. The program
+TRANG_ should be used to generate a correcsponding .rng file. For Ubuntu, you
+can install with:
+
+.. code-block:: bash
+
+ sudo apt-get install trang
+
+To convert the .rnc file to .rng, use the following syntax:
+
+.. code-block:: bash
+
+ trang {filename}.rnc {filename}.rng
+
+.. _TRANG: http://www.thaiopensource.com/relaxng/trang.html
diff --git a/src/relaxng/settings.rng b/src/relaxng/settings.rng
new file mode 100644
index 0000000000..02dba3688e
--- /dev/null
+++ b/src/relaxng/settings.rng
@@ -0,0 +1,704 @@
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 12
+
+
+
+
+ 12
+
+
+
+
+
+
+ 16
+
+
+
+
+ 16
+
+
+
+
+
+
+ 12
+
+
+
+
+ 12
+
+
+
+
+
+
+ 12
+
+
+
+
+ 12
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/relaxng/tallies.rng b/src/relaxng/tallies.rng
new file mode 100644
index 0000000000..60263676be
--- /dev/null
+++ b/src/relaxng/tallies.rng
@@ -0,0 +1,216 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ rectangular
+ hexagonal
+
+
+
+
+ rectangular
+ hexagonal
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 52
+
+
+
+
+ 52
+
+
+
+
+
+
+
+
+ analog
+ tracklength
+
+
+
+
+ analog
+ tracklength
+
+
+
+
+
+
+
+
+
+
+ cell
+ cellborn
+ material
+ universe
+ surface
+ mesh
+ energy
+ energyout
+
+
+
+
+ cell
+ cellborn
+ material
+ universe
+ surface
+ mesh
+ energy
+ energyout
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 12
+
+
+
+
+
+
+
+
+
+ 20
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/xml_validate.py b/src/utils/xml_validate.py
index aa56e6e0cf..e5a45f4691 100755
--- a/src/utils/xml_validate.py
+++ b/src/utils/xml_validate.py
@@ -50,10 +50,10 @@ if not os.path.exists(relaxng_path):
raise Exception("RelaxNG path: {0} does not exist, set with -r "
"command line option.".format(relaxng_path))
-# Make sure there are .rnc files in RelaxNG path
-rnc_files = glob.glob(os.path.join(relaxng_path, "*.rnc"))
-if len(rnc_files) == 0:
- raise Exception("No .rnc files found in RelaxNG "
+# Make sure there are .rng files in RelaxNG path
+rng_files = glob.glob(os.path.join(relaxng_path, "*.rng"))
+if len(rng_files) == 0:
+ raise Exception("No .rng files found in RelaxNG "
"path: {0}.".format(relaxng_path))
# Get list of xml input files
@@ -80,36 +80,22 @@ for xml_file in xml_files:
xml_prefix = os.path.basename(xml_file)
xml_prefix = xml_prefix.split(".")[0]
- # Search for rnc file
- rnc_file = os.path.join(relaxng_path, xml_prefix + ".rnc")
- rng_file = xml_prefix + ".rng"
- if rnc_file in rnc_files:
+ # Search for rng file
+ rng_file = os.path.join(relaxng_path, xml_prefix + ".rng")
+ if rng_file in rng_files:
- # convert RNC to RNG file
- rc = call("trang {0} {1}".format(rnc_file, rng_file), shell=True)
+ # read in RelaxNG
+ relaxng_doc = etree.parse(rng_file)
+ relaxng = etree.RelaxNG(relaxng_doc)
- # check return code
- if rc == 0:
+ # validate xml file again RelaxNG
+ try:
+ relaxng.assertValid(xml_tree)
+ print(BOLD + OK + '[VALID]' + ENDC)
+ except (etree.DocumentInvalid, TypeError) as e:
+ print(BOLD + FAIL + '[NOT VALID]' + ENDC)
+ print(" {0}".format(e))
- # read in RelaxNG
- relaxng_doc = etree.parse(rng_file)
- relaxng = etree.RelaxNG(relaxng_doc)
-
- # validate xml file again RelaxNG
- try:
- relaxng.assertValid(xml_tree)
- print(BOLD + OK + '[VALID]' + ENDC)
- except (etree.DocumentInvalid, TypeError) as e:
- print(BOLD + FAIL + '[NOT VALID]' + ENDC)
- print(" {0}".format(e))
-
- # remove rng file
- os.remove(rng_file)
-
- # trang command failed
- else:
- print(BOLD + FAIL + '[TRANG FAILED]' + ENDC)
-
- # RNC file does not exist
+ # RNG file does not exist
else:
print(BOLD + NOT_FOUND + '[NO RELAXNG FOUND]' + ENDC)