Changeset c6ca23d in sasview for src/sans/dataloader/readers


Ignore:
Timestamp:
Feb 18, 2014 1:47:42 PM (11 years ago)
Author:
Jeff Krzywon <jeffery.krzywon@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
8599f56
Parents:
7eb3aa2
Message:

Fixed the file header writing issue for cansas data files outlined in ticket #204.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sans/dataloader/readers/cansas_reader.py

    re090c624 rc6ca23d  
    500500        ns = CANSAS_NS.get(self.cansas_version).get("ns") 
    501501        doc = xml.dom.minidom.Document() 
     502         
    502503        main_node = doc.createElement("SASroot") 
     504        if self.cansas_version == "1.1": 
     505            pi = doc.createProcessingInstruction('xml-stylesheet', \ 
     506                                    'type="text/xsl" href="cansasxml-html.xsl"') 
     507            root = doc.firstChild 
     508            doc.insertBefore(pi, root) 
    503509        main_node.setAttribute("version", self.cansas_version) 
    504510        main_node.setAttribute("xmlns", ns) 
    505511        main_node.setAttribute("xmlns:xsi", 
    506512                               "http://www.w3.org/2001/XMLSchema-instance") 
    507         main_node.setAttribute("xsi:schemaLocation", "{0} http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd".format(ns)) 
     513        if self.cansas_version == "1.0": 
     514            main_node.setAttribute("xsi:schemaLocation", "cansas1d/1.0 http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd") 
     515        elif self.cansas_version == "1.1": 
     516            main_node.setAttribute("xsi:schemaLocation", "urn:cansas1d:1.1 http://www.cansas.org/formats/1.1/cansas1d.xsd") 
    508517         
    509518        doc.appendChild(main_node) 
Note: See TracChangeset for help on using the changeset viewer.