Index: src/sans/dataloader/data_info.py
===================================================================
--- src/sans/dataloader/data_info.py	(revision ffbe487235261db53473e1fe28d7b1953c7e31dd)
+++ src/sans/dataloader/data_info.py	(revision 75eeb4259b6c50a745eb6eec9691323e3c4f077f)
@@ -401,4 +401,38 @@
         return _str
     
+class TransmissionSpectrum:
+    """
+    Class that holds information about transmission spectrum
+    for white beams and spallation sources.
+    """
+    name = ''
+    timestamp = ''
+    ## Wavelength (float) [A]
+    wavelength = None
+    wavelength_unit = 'A'
+    ## Transmission (float) [unit less]
+    transmission = None
+    transmission_unit = ''
+    ## Transmission Deviation (float) [unit less]
+    transmission_deviation = None
+    transmission_deviation_unit = ''
+    
+    def __init__(self):
+        self.wavelength = []
+        self.transmission = []
+        self.transmission_deviation = []
+    
+    def __str__(self):
+        _str  = "Transmission Spectrum:\n"
+        _str += "   Name:       {0}".format(self.name)
+        _str += "   Timestamp:  {1}".format(self.timestamp)
+        _str += "   Wavelength [{0}] | Transmission [{1}] | Trans Dev [{2}]\n".format(self.wavelength_unit, self.transmission_unit, self.transmission_deviation_unit)
+        for i in range(len(self.wavelength)):
+            _str += "   {0}, {1}".format(self.wavelength[i], self.transmission[i])
+            if len(self.transmission_deviation > i):
+                _str += ", {0}".format(self.transmission_deviation[i])
+            _str += "\n"
+        return _str
+    
   
 class DataInfo:
@@ -431,4 +465,6 @@
     ## Collimation information
     collimation = None
+    ## Transmission Spectrum INfo
+    trans_spectrum = None
     ## Additional meta-data
     meta_data  = None
@@ -461,4 +497,6 @@
         ## Collimation information
         self.collimation = []
+        ## Transmission Spectrum
+        self.trans_spectrum = TransmissionSpectrum()
         ## Additional meta-data
         self.meta_data  = {}
Index: src/sans/dataloader/readers/cansas_constants.py
===================================================================
--- src/sans/dataloader/readers/cansas_constants.py	(revision eda89725afadff916f49a3a51d5823023263ff33)
+++ src/sans/dataloader/readers/cansas_constants.py	(revision 75eeb4259b6c50a745eb6eec9691323e3c4f077f)
@@ -15,5 +15,5 @@
                      "SASentry" : {
                                    "units_optional" : True,
-                                   "variable" : " ",
+                                   "variable" : None,
                                    "storeas" : "content",
                                    "attributes" : {"name" : {"variable" : "{0}.run_name[node_value] = \"{1}\""}},
@@ -26,8 +26,9 @@
                                                  "SASdata" : {
                                                               "attributes" : {"name" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",}},
+                                                              "variable" : None,
                                                               "children" : {"Idata" : {
                                                                                        "storeas" : "float",
+                                                                                       "units_optional" : False,
                                                                                        "variable" : None,
-                                                                                       "units_optional" : False,
                                                                                        "attributes" : {
                                                                                                        "name" : {
@@ -43,8 +44,8 @@
                                                                                                      "Q" : {
                                                                                                             "variable" : "{0}.x = numpy.append({0}.x, {1})",
-                                                                                                            "unit" : "_xunit",
+                                                                                                            "unit" : "x_unit",
                                                                                                             "attributes" : {
                                                                                                                             "unit" : {
-                                                                                                                                      "variable" : "{0}._xunit",
+                                                                                                                                      "variable" : "{0}._xunit = \"{1}\"",
                                                                                                                                       "storeas" : "content"
                                                                                                                                       }
@@ -53,8 +54,8 @@
                                                                                                      "I" : {
                                                                                                             "variable" : "{0}.y = numpy.append({0}.y, {1})",
-                                                                                                            "unit" : "_yunit",
+                                                                                                            "unit" : "y_unit",
                                                                                                             "attributes" : {
                                                                                                                             "unit" : {
-                                                                                                                                      "variable" : "{0}._yunit",
+                                                                                                                                      "variable" : "{0}._yunit = \"{1}\"",
                                                                                                                                       "storeas" : "content"
                                                                                                                                       }
@@ -63,4 +64,5 @@
                                                                                                      "Idev" : {
                                                                                                                "variable" : "{0}.dy = numpy.append({0}.dy, {1})",
+                                                                                                               "unit" : "y_unit",
                                                                                                                "attributes" : {
                                                                                                                                "unit" : {
@@ -72,4 +74,5 @@
                                                                                                      "Qdev" : {
                                                                                                                "variable" : "{0}.dx = numpy.append({0}.dx, {1})",
+                                                                                                               "unit" : "x_unit",
                                                                                                                "attributes" : {
                                                                                                                                "unit" : {
@@ -81,4 +84,5 @@
                                                                                                      "dQw" : {
                                                                                                               "variable" : "{0}.dxw = numpy.append({0}.dxw, {1})",
+                                                                                                              "unit" : "x_unit",
                                                                                                               "attributes" : {
                                                                                                                               "unit" : {
@@ -90,4 +94,5 @@
                                                                                                      "dQl" : {
                                                                                                               "variable" : "{0}.dxl = numpy.append({0}.dxl, {1})",
+                                                                                                              "unit" : "x_unit",
                                                                                                               "attributes" : {
                                                                                                                               "unit" : {
@@ -99,4 +104,5 @@
                                                                                                      "Qmean" : {
                                                                                                                 "storeas" : "content",
+                                                                                                                "unit" : "x_unit",
                                                                                                                 "variable" : "{0}.meta_data[\"{2}\"] = {1}",
                                                                                                                 "attributes" : {"unit" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""}},
@@ -116,18 +122,39 @@
                                                               },
                                                  "SAStransmission_spectrum" : {
+                                                                               "variable" : None,
                                                                                "children" : {
                                                                                              "Tdata" : {
+                                                                                                        "storeas" : "float",
+                                                                                                        "variable" : None,
                                                                                                         "children" : {
                                                                                                                       "Lambda" : {
-                                                                                                                                  "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                                  "attributes" : {"unit" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""}}
+                                                                                                                                  "variable" : "{0}.trans_spectrum.wavelength.append({1})",
+                                                                                                                                  "unit" : "trans_spectrum.wavelength_unit",
+                                                                                                                                  "attributes" : {
+                                                                                                                                                  "unit" : {
+                                                                                                                                                            "variable" : "{0}.trans_spectrum.wavelength_unit = \"{1}\"",
+                                                                                                                                                            "storeas" : "content"
+                                                                                                                                                            }
+                                                                                                                                                  }
                                                                                                                                   },
                                                                                                                       "T" : {
-                                                                                                                             "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                             "attributes" : {"unit" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""}}
+                                                                                                                             "variable" : "{0}.trans_spectrum.transmission.append({1})",
+                                                                                                                             "unit" : "trans_spectrum.transmission_unit",
+                                                                                                                             "attributes" : {
+                                                                                                                                             "unit" : {
+                                                                                                                                                       "variable" : "{0}.trans_spectrum.transmission_unit = \"{1}\"",
+                                                                                                                                                       "storeas" : "content"
+                                                                                                                                                       }
+                                                                                                                                             }
                                                                                                                              },
                                                                                                                       "Tdev" : {
-                                                                                                                                "variable" : "{0}.meta_data[\"{2}\"] = \"{1}\"",
-                                                                                                                                "attributes" : {"unit" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""}}
+                                                                                                                                "variable" : "{0}.trans_spectrum.transmission_deviation.append({1})",
+                                                                                                                                "unit" : "trans_spectrum.transmission_deviation_unit",
+                                                                                                                                "attributes" : {
+                                                                                                                                             "unit" : {
+                                                                                                                                                       "variable" : "{0}.trans_spectrum.transmission_deviation_unit = \"{1}\"",
+                                                                                                                                                       "storeas" : "content"
+                                                                                                                                                       }
+                                                                                                                                             }
                                                                                                                                 },
                                                                                                                       "<any>" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""},
@@ -136,9 +163,10 @@
                                                                                              "<any>" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""},
                                                                                              },
-                                                                               "attributes" : {"name" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""},
-                                                                                               "timestamp" : {"variable" : "{0}.meta_data[\"{2}\"] = \"{1}\""},}
+                                                                               "attributes" : {"name" : {"variable" : "{0}.trans_spectrum.name = \"{1}\""},
+                                                                                               "timestamp" : {"variable" : "{0}.trans_spectrum.timestamp = \"{1}\""},}
                                                                                },
                                                  "SASsample" : {
                                                                 "attributes" : {"name" : {"variable" : "{0}.sample.name = \"{1}\""},},
+                                                                "variable" : None,
                                                                 "children" : {
                                                                               "ID" : {"variable" : "{0}.sample.ID = \"{1}\""},
@@ -171,4 +199,5 @@
                                                                               "position" : {
                                                                                             "children" : {
+                                                                                                          "variable" : None,
                                                                                                           "x" : {
                                                                                                                  "variable" : "{0}.sample.position.x = {1}",
@@ -205,4 +234,5 @@
                                                                                             },
                                                                               "orientation" : {
+                                                                                               "variable" : None,
                                                                                                "children" : {
                                                                                                              "roll" : {
@@ -246,12 +276,16 @@
                                                                 },
                                                  "SASinstrument" : {
+                                                                    "variable" : None,
                                                                     "children" : {
+                                                                                  "variable" : None,
                                                                                   "name" : {"variable" : "{0}.instrument = \"{1}\""},
                                                                                   "SASsource" : {
                                                                                                  "attributes" : {"name" : {"variable" : "{0}.source.name = \"{1}\""}},
+                                                                                                 "variable" : None,
                                                                                                  "children" : {
                                                                                                                "radiation" : {"variable" : "{0}.source.radiation = \"{1}\""},
                                                                                                                "beam_size" : {
                                                                                                                               "attributes" : {"name" : {"variable" : "{0}.source.beam_size_name = \"{1}\""}},
+                                                                                                                              "variable" : None,
                                                                                                                               "children" : {
                                                                                                                                             "x" : {
@@ -343,4 +377,5 @@
                                                                                                                                 },
                                                                                                                     "aperture" : {
+                                                                                                                                  "variable" : None,
                                                                                                                                   "attributes" : {
                                                                                                                                                   "name" : {"variable" : "{0}.name = \"{1}\""},
@@ -386,7 +421,11 @@
                                                                                                                                                                         }
                                                                                                                                                           },
-                                                                                                                                                "distance" : {"attributes" : {"unit" : {"variable" : "{0}.distance_unit = \"{1}\""}},
+                                                                                                                                                "distance" : {
+                                                                                                                                                              "storeas" : "float",
+                                                                                                                                                              "attributes" : {
+                                                                                                                                                                              "storeas" : "content",
+                                                                                                                                                                              "unit" : {"variable" : "{0}.distance_unit = \"{1}\""}},
                                                                                                                                                               "variable" : "{0}.distance = {1}",
-                                                                                                                                                              "unit" : "length_unit",
+                                                                                                                                                              "unit" : "distance_unit",
                                                                                                                                                               }
                                                                                                                                                 }
@@ -419,4 +458,5 @@
                                                                                                                           },
                                                                                                                  "offset" : {
+                                                                                                                             "variable" : None,
                                                                                                                              "children" : {
                                                                                                                                            "x" : {
@@ -453,4 +493,5 @@
                                                                                                                              },
                                                                                                                  "orientation" : {
+                                                                                                                                  "variable" : None,
                                                                                                                                   "children" : {
                                                                                                                                                 "roll" : {
@@ -481,4 +522,5 @@
                                                                                                                                   },
                                                                                                                  "beam_center" : {
+                                                                                                                                  "variable" : None,
                                                                                                                                   "children" : {
                                                                                                                                                 "x" : {
@@ -509,4 +551,5 @@
                                                                                                                                   },
                                                                                                                  "pixel_size" : {
+                                                                                                                                 "variable" : None,
                                                                                                                                  "children" : {
                                                                                                                                                "x" : {
@@ -551,9 +594,9 @@
                                                                     },
                                                  "SASprocess" : {
-                                                                 "variable" : " ",
+                                                                 "variable" : None,
                                                                  "children" : {
-                                                                               "name" : {"variable" : "{0}.name = \"{1}\""},
-                                                                               "date" : {"variable" : "{0}.date = \"{1}\""},
-                                                                               "description" : {"variable" : "{0}.description = \"{1}\""},
+                                                                               "name" : {"variable" : "{0}.name = \'{1}\'"},
+                                                                               "date" : {"variable" : "{0}.date = \'{1}\'"},
+                                                                               "description" : {"variable" : "{0}.description = \'{1}\'"},
                                                                                "term" : {
                                                                                          "variable" : None,
@@ -563,10 +606,12 @@
                                                                                                          }
                                                                                          },
-                                                                               "SASprocessnote" : {"children" : {"<any>" : {"variable" : "{0}.notes.append(\"{2}: {1}\")"}}},
-                                                                               "<any>" : {"variable" : "{0}.notes.append(\"{2}: {1}\")",}
+                                                                               "SASprocessnote" : {
+                                                                                                   "variable" : None,
+                                                                                                   "children" : {"<any>" : {"variable" : "{0}.notes.append(\'2}: {1}\')"}}},
+                                                                               "<any>" : {"variable" : "{0}.notes.append(\'{2}: {1}\')",}
                                                                                },
                                                                  },
-                                                 "SASnote" : {"variable" : "{0}.notes.append(\"{1}\")"},
-                                                 "<any>" : {"variable" : "{0}.meta_data[\"{2}\" = \"{1}\""},
+                                                 "SASnote" : {"variable" : "{0}.notes.append(\'{1}\')"},
+                                                 "<any>" : {"variable" : "{0}.meta_data[\"{2}\"] = \'{1}\'"},
                                                  }
                                    }
Index: src/sans/dataloader/readers/cansas_reader.py
===================================================================
--- src/sans/dataloader/readers/cansas_reader.py	(revision eda89725afadff916f49a3a51d5823023263ff33)
+++ src/sans/dataloader/readers/cansas_reader.py	(revision 75eeb4259b6c50a745eb6eec9691323e3c4f077f)
@@ -123,4 +123,14 @@
     errors = []
     
+    type_name = "canSAS"
+    
+    ## Wildcards
+    type = ["XML files (*.xml)|*.xml"]
+    ## List of allowed extensions
+    ext = ['.xml', '.XML']
+    
+    ## Flag to bypass extension check
+    allow_all = True
+    
     def __init__(self):
         ## List of errors
@@ -156,79 +166,89 @@
         ns = []
         
-        try:
-            # Load in the xml file and get the cansas version from the header
-            self.reader.setXMLFile(xml)
-            root = self.reader.xmlroot
-            self.cansasVersion = root.get("version")
-            # Generic values for the cansas file based on the version
-            cansas_defaults = CANSAS_NS.get(self.cansasVersion)
-        
-            # Link a schema to the XML file.
+        # Check that the file exists
+        if os.path.isfile(xml):
             basename = os.path.basename(xml)
-            base_name = xml_reader.__file__
-            base = base_name.split("\\sans\\")[0]
-            schema_path = "{0}\\sans\\dataloader\\readers\\schema\\{1}".format(base, cansas_defaults.get("schema")).replace("\\", "/")
-            self.reader.setSchema(schema_path)
-        
-            # Try to load the file, but raise an error if unable to.
-            # Check the file matches the XML schema
-            if self.isCansas():
-                # Get each SASentry from the XML file and add it to a list.
-                entry_list = root.xpath('/ns:SASroot/ns:SASentry',
-                                             namespaces={'ns': cansas_defaults.get("ns")})
-                ns.append("SASentry")
-                
-                # If there are multiple files, modify the name for each is unique
-                multipleFiles = len(entry_list) - 1
-                n = 0
-                name = basename
-                # Parse each SASentry item
-                for entry in entry_list:
-                    
-                    # Define a new Data1D object with zeroes for x and y
-                    data1D = Data1D(x,y,dx,dy)
-                    data1D.dxl = dxl
-                    data1D.dxw = dxw
-                    
-                    # If more than one SASentry, number each in order
-                    if multipleFiles:
-                        name += "_{0}".format(n)
-                        n += 1
-                    
-                    # Set the Data1D name and then parse the entry. The entry is appended to a list of entry values
-                    data1D.filename = name
-                    data1D.meta_data["loader"] = "CanSAS 1D"
-                    return_value, extras = self._parse_entry(entry, ns, data1D)
-                    del extras[:]
-                    
-                    #Final cleanup - Remove empty nodes, verify array sizes are correct
-                    return_value.errors = self.errors
-                    del self.errors[:]
-                    numpy.trim_zeros(return_value.x)
-                    numpy.trim_zeros(return_value.y)
-                    numpy.trim_zeros(return_value.dy)
-                    size_dx = return_value.dx.size
-                    size_dxl = return_value.dxl.size
-                    size_dxw = return_value.dxw.size
-                    if size_dxl == 0 and size_dxw == 0:
-                        return_value.dxl = None
-                        return_value.dxw = None
-                        numpy.trim_zeros(return_value.dx)
-                    elif size_dx == 0:
-                        return_value.dx = None
-                        size_dx = size_dxl
-                        numpy.trim_zeros(return_value.dxl)
-                        numpy.trim_zeros(return_value.dxw)
-                    
-                    output.append(return_value)
-            else:
-                # If the file does not match the schema, raise this error
-                raise RuntimeError, "%s cannot be read \n" % xml
-        # If an exception occurs while loading the file, give a descriptive output.
-        except Exception:
-            raise RuntimeError, "%s cannot be read \n" % xml
+            _, extension = os.path.splitext(basename)
+            # If the fiel type is not allowed, return nothing
+            if extension in self.ext or self.allow_all:
+                base_name = xml_reader.__file__
+                base = base_name.split("\\sans\\")[0]
+                
+                # Load in the xml file and get the cansas version from the header
+                self.reader.setXMLFile(xml)
+                root = self.reader.xmlroot
+                if root is None:
+                    root = {}
+                self.cansasVersion = root.get("version", "1.0")
+                
+                # Generic values for the cansas file based on the version
+                cansas_defaults = CANSAS_NS.get(self.cansasVersion, "1.0")
+                schema_path = "{0}\\sans\\dataloader\\readers\\schema\\{1}".format(base, cansas_defaults.get("schema")).replace("\\", "/")
+                
+                # Link a schema to the XML file.
+                self.reader.setSchema(schema_path)
             
+                # Try to load the file, but raise an error if unable to.
+                # Check the file matches the XML schema
+                try:
+                    if self.isCansas():
+                        # Get each SASentry from the XML file and add it to a list.
+                        entry_list = root.xpath('/ns:SASroot/ns:SASentry',
+                                                     namespaces={'ns': cansas_defaults.get("ns")})
+                        ns.append("SASentry")
+                        
+                        # If there are multiple files, modify the name for each is unique
+                        multipleFiles = len(entry_list) - 1
+                        n = 0
+                        name = basename
+                        # Parse each SASentry item
+                        for entry in entry_list:
+                            
+                            # Define a new Data1D object with zeroes for x and y
+                            data1D = Data1D(x,y,dx,dy)
+                            data1D.dxl = dxl
+                            data1D.dxw = dxw
+                            
+                            # If more than one SASentry, number each in order
+                            if multipleFiles:
+                                name += "_{0}".format(n)
+                                n += 1
+                            
+                            # Set the Data1D name and then parse the entry. The entry is appended to a list of entry values
+                            data1D.filename = name
+                            data1D.meta_data["loader"] = "CanSAS 1D"
+                            return_value, extras = self._parse_entry(entry, ns, data1D)
+                            del extras[:]
+                            
+                            #Final cleanup - Remove empty nodes, verify array sizes are correct
+                            for error in self.errors:
+                                return_value.errors.append(error)
+                            del self.errors[:]
+                            numpy.trim_zeros(return_value.x)
+                            numpy.trim_zeros(return_value.y)
+                            numpy.trim_zeros(return_value.dy)
+                            size_dx = return_value.dx.size
+                            size_dxl = return_value.dxl.size
+                            size_dxw = return_value.dxw.size
+                            if size_dxl == 0 and size_dxw == 0:
+                                return_value.dxl = None
+                                return_value.dxw = None
+                                numpy.trim_zeros(return_value.dx)
+                            elif size_dx == 0:
+                                return_value.dx = None
+                                size_dx = size_dxl
+                                numpy.trim_zeros(return_value.dxl)
+                                numpy.trim_zeros(return_value.dxw)
+                            
+                            output.append(return_value)
+                    else:
+                        value = self.reader.findInvalidXML()
+                        output.append("Invalid XML at: {0}".format(value))
+                except:
+                    # If the file does not match the schema, raise this error
+                    raise RuntimeError, "%s cannot be read \n" % xml
+                return output
         # Return a list of parsed entries that dataloader can manage
-        return output
+        return None
     
     def _create_unique_key(self, dictionary, name, i):
@@ -264,5 +284,5 @@
     def _unit_conversion(self, new_current_level, attr, data1D, node_value, optional = True):
         value_unit = ''
-        if 'unit' in attr and 'unit' in new_current_level:
+        if 'unit' in attr and new_current_level.get('unit') is not None:
             try:
                 if isinstance(node_value, float) is False:
@@ -270,7 +290,8 @@
                 default_unit = None
                 unitname = new_current_level.get("unit")
-                exec "default_unit = data1D.{0}.lower()".format(unitname)
-                local_unit = attr['unit'].lower()
-                if local_unit != default_unit:
+                exec "default_unit = data1D.{0}".format(unitname)
+                local_unit = attr['unit']
+                if local_unit.lower() != default_unit.lower() and local_unit is not None\
+                    and local_unit.lower() != "none" and default_unit is not None:
                     if HAS_CONVERTER == True:
                         try:
@@ -279,24 +300,34 @@
                             exec "node_value = data_conv_q(node_value, units=data1D.{0})".format(unitname)
                         except:
-                            msg = "CanSAS reader: could not convert "
-                            msg += "Q unit [%s]; " % attr['unit'],
-                            exec "msg += \"expecting [%s]\n  %s\" % (data1D.{0}, sys.exc_info()[1])".format(unitname)
-                            raise ValueError, msg
+                            err_msg = "CanSAS reader: could not convert "
+                            err_msg += "Q unit {0}; ".format(local_unit)
+                            intermediate = "err_msg += \"expecting [{1}]  {2}\".format(data1D.{0}, sys.exc_info()[1])".format(unitname, "{0}", "{1}")
+                            exec intermediate
+                            self.errors.append(err_msg)
+                            if optional:
+                                logging.info(err_msg)
+                            else:
+                                raise ValueError, err_msg
                     else:
                         value_unit = local_unit
-                        err_mess = "CanSAS reader: unrecognized %s unit [%s];"\
+                        err_msg = "CanSAS reader: unrecognized %s unit [%s];"\
                         % (node_value, default_unit)
-                        err_mess += " expecting [%s]" % local_unit
-                        self.errors.append(err_mess)
+                        err_msg += " expecting [%s]" % local_unit
+                        self.errors.append(err_msg)
                         if optional:
-                            logging.info(err_mess)
+                            logging.info(err_msg)
                         else:
-                            raise ValueError, err_mess
-            except Exception as e:
-                msg = "CanSAS reader: could not convert "
-                msg += "Q unit [%s]; " % attr['unit'],
-                exec "msg += \"expecting [%s]\n  %s\" % (data1D.{0}, sys.exc_info()[1])".format(unitname)
-                self.errors.append(msg)
-                raise ValueError, msg
+                            raise ValueError, err_msg
+                else:
+                    value_unit = local_unit
+            except:
+                err_msg = "CanSAS reader: could not convert "
+                err_msg += "Q unit [%s]; " % attr['unit'],
+                exec "err_msg += \"expecting [%s]\n  %s\" % (data1D.{0}, sys.exc_info()[1])".format(unitname)
+                self.errors.append(err_msg)
+                if optional:
+                    logging.info(err_msg)
+                else:
+                    raise ValueError, err_msg
         elif 'unit' in attr:
             value_unit = attr['unit']
@@ -340,8 +371,8 @@
                             term_attr = {}
                             for attr in child.keys():
-                                term_attr[attr] = child.get(attr).strip()
+                                term_attr[attr] = ' '.join(child.get(attr).split())
                             if child.text is not None:
-                                term_attr['value'] = child.text.strip()
-                                data1D.term.append(term_attr)
+                                term_attr['value'] = ' '.join(child.text.split())
+                            data1D.term.append(term_attr)
                 elif tagname == "aperture":
                     data1D = Aperture()
@@ -356,15 +387,13 @@
                 #Get the information from the node
                 node_value = node.text
-                if node_value is not None:
-                    node_value = node_value.strip().replace("\r"," ").replace("\n"," ")
                 if node_value == "":
                     node_value = None
+                if node_value is not None:
+                    node_value = ' '.join(node_value.split())
                 
                 # If the value is a float, compile with units.
                 if ns_datatype == "float":
                     # If an empty value is given, store as zero.
-                    if node_value is None:
-                        node_value = "0.0"
-                    elif node_value.isspace():
+                    if node_value is None or node_value.isspace() or node_value.lower() == "nan":
                         node_value = "0.0"
                     node_value, unit = self._unit_conversion(new_current_level, attr, data1D, node_value, optional)
@@ -438,12 +467,13 @@
             raise RuntimeError, "The cansas writer expects a Data1D instance"
         
+        ns = CANSAS_NS.get(self.cansasVersion).get("ns")
         doc = xml.dom.minidom.Document()
         main_node = doc.createElement("SASroot")
-        main_node.setAttribute("cansasVersion", self.cansasVersion)
-        main_node.setAttribute("xmlns", "cansas1d/%s" % self.cansasVersion)
+        main_node.setAttribute("version", self.cansasVersion)
+        main_node.setAttribute("xmlns", ns)
         main_node.setAttribute("xmlns:xsi",
                                "http://www.w3.org/2001/XMLSchema-instance")
         main_node.setAttribute("xsi:schemaLocation",
-                               "cansas1d/%s http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd" % self.cansasVersion)
+                               "{0} http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd".format(ns))
         
         doc.appendChild(main_node)
@@ -471,16 +501,32 @@
                 write_node(doc, pt, "I", datainfo.y[i],
                             {'unit': datainfo.y_unit})
+            if datainfo.dy != None and len(datainfo.dy) >= i:
+                write_node(doc, pt, "Idev", datainfo.dy[i],
+                            {'unit': datainfo.y_unit})
             if datainfo.dx != None and len(datainfo.dx) >= i:
                 write_node(doc, pt, "Qdev", datainfo.dx[i],
+                            {'unit': datainfo.x_unit})
+            if datainfo.dxw != None and len(datainfo.dxw) >= i:
+                write_node(doc, pt, "dQw", datainfo.dxw[i],
                             {'unit': datainfo.x_unit})
             if datainfo.dxl != None and len(datainfo.dxl) >= i:
                 write_node(doc, pt, "dQl", datainfo.dxl[i],
                             {'unit': datainfo.x_unit})
-            if datainfo.dxw != None and len(datainfo.dxw) >= i:
-                write_node(doc, pt, "dQw", datainfo.dxw[i],
-                            {'unit': datainfo.x_unit})
-            if datainfo.dy != None and len(datainfo.dy) >= i:
-                write_node(doc, pt, "Idev", datainfo.dy[i],
-                            {'unit': datainfo.y_unit})
+
+        # Transmission Spectrum Info
+        if len(datainfo.trans_spectrum.wavelength) > 0:
+            node = doc.createElement("SAStransmission_spectrum")
+            entry_node.appendChild(node)
+            for i in range(len(datainfo.trans_spectrum.wavelength)):
+                pt = doc.createElement("Tdata")
+                node.appendChild(pt)
+                write_node(doc, pt, "Lambda", datainfo.trans_spectrum.wavelength[i], 
+                           {'unit': datainfo.trans_spectrum.wavelength_unit})
+                write_node(doc, pt, "T", datainfo.trans_spectrum.transmission[i], 
+                           {'unit': datainfo.trans_spectrum.transmission_unit})
+                if datainfo.trans_spectrum.transmission_deviation != None \
+                and len(datainfo.trans_spectrum.transmission_deviation) >= i:
+                    write_node(doc, pt, "Tdev", datainfo.trans_spectrum.transmission_deviation[i], 
+                               {'unit': datainfo.trans_spectrum.transmission_deviation_unit})
 
         # Sample info
@@ -495,7 +541,4 @@
         write_node(doc, sample, "temperature", datainfo.sample.temperature,
                    {"unit": datainfo.sample.temperature_unit})
-        
-        for item in datainfo.sample.details:
-            write_node(doc, sample, "details", item)
         
         pos = doc.createElement("position")
@@ -524,4 +567,7 @@
             sample.appendChild(ori)
         
+        for item in datainfo.sample.details:
+            write_node(doc, sample, "details", item)
+        
         # Instrument info
         instr = doc.createElement("SASinstrument")
@@ -535,7 +581,6 @@
             source.setAttribute("name", str(datainfo.source.name))
         instr.appendChild(source)
-        
         write_node(doc, source, "radiation", datainfo.source.radiation)
-        write_node(doc, source, "beam_shape", datainfo.source.beam_shape)
+        
         size = doc.createElement("beam_size")
         if datainfo.source.beam_size_name is not None:
@@ -552,4 +597,5 @@
             source.appendChild(size)
             
+        write_node(doc, source, "beam_shape", datainfo.source.beam_shape)
         write_node(doc, source, "wavelength",
                    datainfo.source.wavelength,
@@ -583,7 +629,4 @@
                 coll.appendChild(ap)
                 
-                write_node(doc, ap, "distance", apert.distance,
-                           {"unit": apert.distance_unit})
-                
                 size = doc.createElement("size")
                 if apert.size_name is not None:
@@ -597,4 +640,7 @@
                 if written == True:
                     ap.appendChild(size)
+                
+                write_node(doc, ap, "distance", apert.distance,
+                           {"unit": apert.distance_unit})
 
         #   Detectors
@@ -604,7 +650,4 @@
             written = written | write_node(doc, det, "SDD", item.distance,
                                            {"unit": item.distance_unit})
-            written = written | write_node(doc, det, "slit_length",
-                                           item.slit_length,
-                                           {"unit": item.slit_length_unit})
             if written == True:
                 instr.appendChild(det)
@@ -619,4 +662,16 @@
             if written == True:
                 det.appendChild(off)
+                
+            ori = doc.createElement("orientation")
+            written = write_node(doc, ori, "roll", item.orientation.x,
+                                 {"unit": item.orientation_unit})
+            written = written | write_node(doc, ori, "pitch",
+                                           item.orientation.y,
+                                           {"unit": item.orientation_unit})
+            written = written | write_node(doc, ori, "yaw",
+                                           item.orientation.z,
+                                           {"unit": item.orientation_unit})
+            if written == True:
+                det.appendChild(ori)
             
             center = doc.createElement("beam_center")
@@ -641,17 +696,8 @@
             if written == True:
                 det.appendChild(pix)
-                
-            ori = doc.createElement("orientation")
-            written = write_node(doc, ori, "roll", item.orientation.x,
-                                 {"unit": item.orientation_unit})
-            written = written | write_node(doc, ori, "pitch",
-                                           item.orientation.y,
-                                           {"unit": item.orientation_unit})
-            written = written | write_node(doc, ori, "yaw",
-                                           item.orientation.z,
-                                           {"unit": item.orientation_unit})
-            if written == True:
-                det.appendChild(ori)
-                
+            written = written | write_node(doc, det, "slit_length",
+                                           item.slit_length,
+                                           {"unit": item.slit_length_unit})
+            
         # Processes info
         for item in datainfo.process:
@@ -668,5 +714,20 @@
             for note in item.notes:
                 write_node(doc, node, "SASprocessnote", note)
-        
+            if len(item.notes) == 0:
+                write_node(doc, node, "SASprocessnote", "")
+                
+        # Note info
+        if len(datainfo.notes) == 0:
+            node = doc.createElement("SASnote")
+            entry_node.appendChild(node)
+            if node.hasChildNodes():
+                for child in node.childNodes:
+                    node.removeChild(child)
+        else:
+            for item in datainfo.notes:
+                node = doc.createElement("SASnote")
+                entry_node.appendChild(node)
+                node.appendChild(doc.createTextNode(item))
+                
         # Return the document, and the SASentry node associated with
         # the data we just wrote
Index: src/sans/dataloader/readers/schema/cansas1d_v1_0.xsd
===================================================================
--- src/sans/dataloader/readers/schema/cansas1d_v1_0.xsd	(revision 75eeb4259b6c50a745eb6eec9691323e3c4f077f)
+++ src/sans/dataloader/readers/schema/cansas1d_v1_0.xsd	(revision 75eeb4259b6c50a745eb6eec9691323e3c4f077f)
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="xsd-documentation.xsl" ?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"  jaxb:version="2.0"
+	targetNamespace="cansas1d/1.0" xmlns:tns="cansas1d/1.0"
+	elementFormDefault="qualified">
+
+<!-- JAXB: http://java.sun.com/developer/technicalArticles/WebServices/jaxb/ -->
+
+	<complexType name="floatUnitType">
+		<simpleContent>
+			<extension base="float">
+				<attribute name="unit" type="string" use="required" />
+			</extension>
+		</simpleContent>
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<group name="positionGroup">
+		<sequence>
+			<element name="x" type="tns:floatUnitType" minOccurs="0" maxOccurs="1" />
+			<element name="y" type="tns:floatUnitType" minOccurs="0" maxOccurs="1" />
+			<element name="z" type="tns:floatUnitType" minOccurs="0" maxOccurs="1" />
+		</sequence>
+	</group>
+
+	<complexType name="positionType">
+		<group ref="tns:positionGroup" />
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<group name="orientationGroup">
+		<sequence>
+			<element name="roll" type="tns:floatUnitType" minOccurs="0"  maxOccurs="1" />
+			<element name="pitch" type="tns:floatUnitType" minOccurs="0" maxOccurs="1" />
+			<element name="yaw" type="tns:floatUnitType" minOccurs="0"   maxOccurs="1" />
+		</sequence>
+	</group>
+
+	<complexType name="orientationType">
+		<group ref="tns:orientationGroup" />
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="IdataType">
+		<sequence>
+			<element name="Q" minOccurs="1" maxOccurs="1"    type="tns:floatUnitType" />
+			<element name="I" minOccurs="1" maxOccurs="1"    type="tns:floatUnitType" />
+			<element name="Idev" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+			<xsd:choice>
+				<!-- [ [Qdev] | [[dQw] | [dQl]] ] -->
+				<element name="Qdev" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+				<xsd:sequence>
+					<element name="dQw" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+					<element name="dQl" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+				</xsd:sequence>
+			</xsd:choice>
+			<element name="Qmean" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+			<element name="Shadowfactor" minOccurs="0" maxOccurs="1" type="float" default="1.0" />
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+		</sequence>
+	</complexType>
+
+	<complexType name="SASdataType">
+		<sequence>
+			<element name="Idata" minOccurs="1" maxOccurs="unbounded" type="tns:IdataType" />
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASsampleType">
+		<sequence>
+			<element name="ID" minOccurs="1" maxOccurs="1" type="string" />
+			<element name="thickness" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="transmission" minOccurs="0" maxOccurs="1" type="float" />
+			<element name="temperature" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="position" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="orientation" minOccurs="0" maxOccurs="1" type="tns:orientationType" />
+			<element name="details" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="termType">
+		<simpleContent>
+			<extension base="string">
+				<attribute name="name" type="string" use="optional" default="" />
+				<attribute name="unit" type="string" use="optional"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASprocessType">
+		<annotation>
+			<appinfo>
+				<!-- JAXB: simplify class name -->
+				<jaxb:property name="SASprocess" />
+			</appinfo>
+		</annotation>
+		<sequence>
+			<element name="name" minOccurs="0" maxOccurs="1"
+				type="string" default="">
+				<annotation>
+					<appinfo>
+						<!-- Remap collision of Name when using JAXB -->
+						<jaxb:property name="SASprocessName" />
+					</appinfo>
+				</annotation>
+			</element>
+			<element name="date" minOccurs="0" maxOccurs="1" type="string" />
+			<element name="description" minOccurs="0" maxOccurs="1" />
+			<element name="term" minOccurs="0" maxOccurs="unbounded" type="tns:termType" />
+			<element name="SASprocessnote" minOccurs="1" maxOccurs="unbounded" />
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="">
+			<annotation>
+				<appinfo>
+					<!-- Remap collision of Name when using JAXB -->
+					<jaxb:property name="SASprocessNameAttr" />
+				</appinfo>
+			</annotation>
+		</attribute>
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASsourceType">
+		<sequence>
+			<element name="radiation" minOccurs="1" maxOccurs="1" type="string" />
+			<element name="beam_size" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="beam_shape" minOccurs="0" maxOccurs="1" type="string" />
+			<element name="wavelength" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="wavelength_min" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="wavelength_max" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="wavelength_spread" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<complexType name="SAScollimationType">
+		<sequence>
+			<element name="length" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="aperture" minOccurs="0"
+				maxOccurs="unbounded">
+				<complexType>
+					<sequence>
+						<element name="size" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+						<element name="distance" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+					</sequence>
+					<attribute name="name" type="string" use="optional" default="" />
+					<attribute name="type" type="string" use="optional" default="" />
+				</complexType>
+			</element>
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<complexType name="SASdetectorType">
+		<sequence>
+			<element name="name" minOccurs="1" maxOccurs="1" type="string" default=""/>
+			<element name="SDD" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="offset" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="orientation" minOccurs="0" maxOccurs="1" type="tns:orientationType" />
+			<element name="beam_center" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="pixel_size" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="slit_length" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+		</sequence>
+	</complexType>
+
+	<complexType name="SASinstrumentType">
+		<sequence>
+			<element name="name" type="string" minOccurs="1" maxOccurs="1" default="" />
+			<element name="SASsource" type="tns:SASsourceType" minOccurs="1" maxOccurs="1" />
+			<element name="SAScollimation" type="tns:SAScollimationType" minOccurs="1" maxOccurs="unbounded" />
+			<element name="SASdetector" type="tns:SASdetectorType" minOccurs="1" maxOccurs="unbounded" />
+		</sequence>
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASentryType">
+		<sequence>
+			<element name="Title" minOccurs="1" maxOccurs="1" type="string" />
+			<element name="Run" minOccurs="1" maxOccurs="unbounded">
+				<xsd:complexType>
+					<simpleContent>
+						<extension base="string">
+							<attribute name="name" type="string" use="optional" default="" />
+						</extension>
+					</simpleContent>
+				</xsd:complexType>
+			</element>
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+			<element name="SASdata" minOccurs="1" maxOccurs="unbounded" type="tns:SASdataType" />
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other">
+				<!-- Is a second *any* element needed here? -->
+				<annotation>
+					<appinfo>
+						<!-- Remap collision of Any when using JAXB --> 
+						<jaxb:property name="SASentryAny2" />
+					</appinfo>
+				</annotation>
+			</xsd:any>
+			<element name="SASsample" type="tns:SASsampleType" />
+			<element name="SASinstrument" type="tns:SASinstrumentType" minOccurs="1" maxOccurs="1" />
+			<element name="SASprocess" type="tns:SASprocessType" minOccurs="0" maxOccurs="unbounded" />
+			<element name="SASnote" minOccurs="1" maxOccurs="unbounded" />
+				<!-- SASnote is a free-form element.
+					Do not define any content for it or it will become restrictive.
+				-->
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASrootType">
+		<sequence>
+			<element name="SASentry" minOccurs="1" maxOccurs="unbounded" type="tns:SASentryType" />
+		</sequence>
+		<attribute name="version" type="string" fixed="1.0" use="required" />
+	</complexType>
+
+	<element name="SASroot" type="tns:SASrootType" />
+
+</schema>
Index: src/sans/dataloader/readers/schema/cansas1d_v1_1.xsd
===================================================================
--- src/sans/dataloader/readers/schema/cansas1d_v1_1.xsd	(revision 75eeb4259b6c50a745eb6eec9691323e3c4f077f)
+++ src/sans/dataloader/readers/schema/cansas1d_v1_1.xsd	(revision 75eeb4259b6c50a745eb6eec9691323e3c4f077f)
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="xsd-documentation.xsl" ?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"  jaxb:version="2.0"
+	targetNamespace="urn:cansas1d:1.1" xmlns:tns="urn:cansas1d:1.1"
+	elementFormDefault="qualified">
+
+<!-- 
+Copyright (c) 2013, UChicago Argonne, LLC
+This file is distributed subject to a Software License Agreement found
+in the file LICENSE that is included with this distribution. 
+ -->
+ 
+<!-- JAXB: http://java.sun.com/developer/technicalArticles/WebServices/jaxb/ -->
+
+	<complexType name="floatUnitType">
+		<simpleContent>
+			<extension base="float">
+				<attribute name="unit" type="string" use="required" />
+			</extension>
+		</simpleContent>
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<group name="positionGroup">
+		<sequence>
+			<element name="x" type="tns:floatUnitType" minOccurs="0" maxOccurs="1" />
+			<element name="y" type="tns:floatUnitType" minOccurs="0" maxOccurs="1" />
+			<element name="z" type="tns:floatUnitType" minOccurs="0" maxOccurs="1" />
+		</sequence>
+	</group>
+
+	<complexType name="positionType">
+		<group ref="tns:positionGroup" />
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<group name="orientationGroup">
+		<sequence>
+			<element name="roll" type="tns:floatUnitType" minOccurs="0"  maxOccurs="1" />
+			<element name="pitch" type="tns:floatUnitType" minOccurs="0" maxOccurs="1" />
+			<element name="yaw" type="tns:floatUnitType" minOccurs="0"   maxOccurs="1" />
+		</sequence>
+	</group>
+
+	<complexType name="orientationType">
+		<group ref="tns:orientationGroup" />
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	
+	<complexType name="IdataType">
+		<sequence>
+			<element name="Q" minOccurs="1" maxOccurs="1"    type="tns:floatUnitType" />
+			<element name="I" minOccurs="1" maxOccurs="1"    type="tns:floatUnitType" />
+			<element name="Idev" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+			<xsd:choice>
+				<!-- [ [Qdev] | [[dQw] | [dQl]] ] -->
+				<element name="Qdev" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+				<xsd:sequence>
+					<element name="dQw" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+					<element name="dQl" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+				</xsd:sequence>
+			</xsd:choice>
+			<element name="Qmean" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+			<element name="Shadowfactor" minOccurs="0" maxOccurs="1" type="float" default="1.0" />
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+		</sequence>
+	</complexType>
+	
+	<complexType name="SASdataType">
+		<sequence minOccurs="1" maxOccurs="1">  <!-- http://svn.cansas.org/trac/ticket/21 -->
+			<sequence>
+				<element name="Idata" minOccurs="1" maxOccurs="unbounded" type="tns:IdataType" />
+			</sequence>
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+		<attribute name="timestamp" type="dateTime" use="optional" />
+	</complexType>
+	
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+	
+	<complexType name="TdataType">
+			<sequence>
+				<element name="Lambda" minOccurs="1" maxOccurs="1"    type="tns:floatUnitType" />
+				<element name="T" minOccurs="1" maxOccurs="1"    type="tns:floatUnitType" />
+				<element name="Tdev" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" default="0" />
+				<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+		</sequence>
+	</complexType>
+	
+	<complexType name="SAStransmission_spectrumType">
+		<sequence minOccurs="1" maxOccurs="1">
+			<sequence minOccurs="1" maxOccurs="1">
+				<element name="Tdata" minOccurs="1" maxOccurs="unbounded" type="tns:TdataType" />
+			</sequence>
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+		<attribute name="timestamp" type="dateTime" use="optional" />
+	</complexType>
+	
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASsampleType">
+		<sequence>
+			<element name="ID" minOccurs="1" maxOccurs="1" type="string" />
+			<element name="thickness" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="transmission" minOccurs="0" maxOccurs="1" type="float" />
+			<element name="temperature" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="position" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="orientation" minOccurs="0" maxOccurs="1" type="tns:orientationType" />
+			<element name="details" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="termType">
+		<simpleContent>
+			<extension base="string">
+				<attribute name="name" type="string" use="optional" default="" />
+				<attribute name="unit" type="string" use="optional"/>
+			</extension>
+		</simpleContent>
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASprocessType">
+		<annotation>
+			<appinfo>
+				<!-- JAXB: simplify class name -->
+				<jaxb:property name="SASprocess" />
+			</appinfo>
+		</annotation>
+		<sequence>
+			<element name="name" minOccurs="0" maxOccurs="1"
+				type="string" default="">
+				<annotation>
+					<appinfo>
+						<!-- Remap collision of Name when using JAXB -->
+						<jaxb:property name="SASprocessName" />
+					</appinfo>
+				</annotation>
+			</element>
+			<element name="date" minOccurs="0" maxOccurs="1" type="string" />
+			<element name="description" minOccurs="0" maxOccurs="1" />
+			<element name="term" minOccurs="0" maxOccurs="unbounded" type="tns:termType" />
+			<element name="SASprocessnote" minOccurs="1" maxOccurs="unbounded" />
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="">
+			<annotation>
+				<appinfo>
+					<!-- Remap collision of Name when using JAXB -->
+					<jaxb:property name="SASprocessNameAttr" />
+				</appinfo>
+			</annotation>
+		</attribute>
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASsourceType">
+		<sequence>
+			<element name="radiation" minOccurs="1" maxOccurs="1" type="string" />
+			<element name="beam_size" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="beam_shape" minOccurs="0" maxOccurs="1" type="string" />
+			<element name="wavelength" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="wavelength_min" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="wavelength_max" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="wavelength_spread" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<complexType name="SAScollimationType">
+		<sequence>
+			<element name="length" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="aperture" minOccurs="0"
+				maxOccurs="unbounded">
+				<complexType>
+					<sequence>
+						<element name="size" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+						<element name="distance" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+					</sequence>
+					<attribute name="name" type="string" use="optional" default="" />
+					<attribute name="type" type="string" use="optional" default="" />
+				</complexType>
+			</element>
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<complexType name="SASdetectorType">
+		<sequence>
+			<element name="name" minOccurs="1" maxOccurs="1" type="string" default=""/>
+			<element name="SDD" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+			<element name="offset" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="orientation" minOccurs="0" maxOccurs="1" type="tns:orientationType" />
+			<element name="beam_center" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="pixel_size" minOccurs="0" maxOccurs="1" type="tns:positionType" />
+			<element name="slit_length" minOccurs="0" maxOccurs="1" type="tns:floatUnitType" />
+		</sequence>
+	</complexType>
+
+	<complexType name="SASinstrumentType">
+		<sequence>
+			<element name="name" type="string" minOccurs="1" maxOccurs="1" default="" />
+			<element name="SASsource" type="tns:SASsourceType" minOccurs="1" maxOccurs="1" />
+			<element name="SAScollimation" type="tns:SAScollimationType" minOccurs="1" maxOccurs="unbounded" />
+			<element name="SASdetector" type="tns:SASdetectorType" minOccurs="1" maxOccurs="unbounded" />
+		</sequence>
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASentryType">
+		<sequence>
+			<element name="Title" minOccurs="1" maxOccurs="1" type="string" />
+			<element name="Run" minOccurs="1" maxOccurs="unbounded">
+				<xsd:complexType>
+					<simpleContent>
+						<extension base="string">
+							<attribute name="name" type="string" use="optional" default="" />
+						</extension>
+					</simpleContent>
+				</xsd:complexType>
+			</element>
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other" />
+			<element name="SASdata" minOccurs="1" maxOccurs="unbounded" type="tns:SASdataType" />
+			<element name="SAStransmission_spectrum" minOccurs="0" maxOccurs="unbounded" type="tns:SAStransmission_spectrumType"/>
+			<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip" namespace="##other">
+				<!-- Is a second *any* element needed here? -->
+				<annotation>
+					<appinfo>
+						<!-- Remap collision of Any when using JAXB --> 
+						<jaxb:property name="SASentryAny2" />
+					</appinfo>
+				</annotation>
+			</xsd:any>
+			<element name="SASsample" type="tns:SASsampleType" />
+			<element name="SASinstrument" type="tns:SASinstrumentType" minOccurs="1" maxOccurs="1" />
+			<element name="SASprocess" type="tns:SASprocessType" minOccurs="0" maxOccurs="unbounded" />
+			<element name="SASnote" minOccurs="1" maxOccurs="unbounded" />
+				<!-- SASnote is a free-form element.
+					Do not define any content for it or it will become restrictive.
+				-->
+		</sequence>
+		<attribute name="name" type="string" use="optional" default="" />
+	</complexType>
+
+	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+	<complexType name="SASrootType">
+		<sequence>
+			<element name="SASentry" minOccurs="1" maxOccurs="unbounded" type="tns:SASentryType" />
+		</sequence>
+		<attribute name="version" type="string" fixed="1.1" use="required" />
+	</complexType>
+
+	<element name="SASroot" type="tns:SASrootType" />
+
+</schema>
