← Back to team overview

mlhim-specs-dev team mailing list archive

[Branch ~cdd-dev/cdd/trunk] Rev 241: Added complexType for NUMBER.

 

------------------------------------------------------------
revno: 241
committer: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>
branch nick: cdd
timestamp: Thu 2012-08-30 19:29:40 -0300
message:
  Added complexType for NUMBER.
modified:
  src/xls2ccd/xls2ccd.py


--
lp:cdd
https://code.launchpad.net/~cdd-dev/cdd/trunk

Your team MLHIM Specifications Developers is subscribed to branch lp:cdd.
To unsubscribe from this branch go to https://code.launchpad.net/~cdd-dev/cdd/trunk/+edit-subscription
=== modified file 'src/xls2ccd/xls2ccd.py'
--- src/xls2ccd/xls2ccd.py	2012-08-30 22:13:51 +0000
+++ src/xls2ccd/xls2ccd.py	2012-08-30 22:29:40 +0000
@@ -69,6 +69,7 @@
     title = ccd_dict[k][0]
     print ""
     print "Generating: "+ title +" --  CCD ID = " + ccd_id
+    print ccd_dict[k][5]
     ccd_catalog.write('{0:<40}'.format(title) + ccd_id +'\n')
     description = ccd_dict[k][1] + "\n" +"          CDE Version: "+ccd_dict[k][3] + "\n" + "           Datatype: "+ccd_dict[k][5] + "\n"+ "           UOM: "+ccd_dict[k][6] + "\n" + "           Format: "+ccd_dict[k][7]
     date = str(now)
@@ -179,6 +180,19 @@
     </xs:complexType>
         """)
 
+    elif dt == "NUMBER":
+        f.write("""
+    <xs:complexType name='"""+dct+"""'>
+      <xs:complexContent>
+        <xs:restriction base="mlhim2:Dv*****Type"> <!-- This will require a DvCount, DvQuantity or other numeric type. Add elements inside the sequence, below data_name, as required. -->
+        <xs:sequence>
+          <xs:element name="data_name"  minOccurs="1"  maxOccurs="1" type="xs:string" fixed='"""+data_name+"""'/>
+        </xs:sequence>
+        </xs:restriction>
+      </xs:complexContent>
+    </xs:complexType>
+        """)
+
     elif len(ccd_dict[k]) > 8:
         f.write("""
     <xs:complexType name='"""+dct+"""'>