← Back to team overview

mlhim-specs-dev team mailing list archive

[Branch ~cdd-dev/cdd/trunk] Rev 148: Bug # 1020602 fix.

 

------------------------------------------------------------
revno: 148
committer: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>
branch nick: cdd
timestamp: Tue 2012-07-03 12:16:14 -0300
message:
  Bug # 1020602 fix.
modified:
  Generator/cdg/cdg_custom.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 'Generator/cdg/cdg_custom.py'
--- Generator/cdg/cdg_custom.py	2012-07-02 17:23:35 +0000
+++ Generator/cdg/cdg_custom.py	2012-07-03 15:16:14 +0000
@@ -13,19 +13,19 @@
     contributors_formated = '<dc:contributor>' + \
         '</dc:contributor>\n<dc:contributor>'.join([ escape(i).strip() for i in contributor.split(';')]) + \
         '</dc:contributor>'
-    
+
     f = open(path+'/'+schema,'w')
 
     f.write("""<?xml version="1.1" encoding="UTF-8"?>
 
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
-	   xmlns:mlhim2="http://www.mlhim.org/xmls/mlhim2/2_3_0"; 
-	   elementFormDefault="qualified" 
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
+	   xmlns:mlhim2="http://www.mlhim.org/xmls/mlhim2/2_3_0";
+	   elementFormDefault="qualified"
 	   targetNamespace="http://www.mlhim.org/xmls/mlhim2/2_3_0";>
 
   <xs:annotation>
     <xs:documentation source="http://www.mlhim.org"; xml:lang="{language}">
-      This is a {title} Concept Constraint Definition schema file (CCD).  
+      This is a {title} Concept Constraint Definition schema file (CCD).
 
       <rdf:RDF
 	  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
@@ -53,41 +53,42 @@
 
     </xs:documentation>
   </xs:annotation>
-  
+
   <xs:include schemaLocation="http://www.mlhim.org/xmls/mlhim2/2_3_0/mlhim2.xsd"/>
-  
+
   <xs:element name='CCD' type="mlhim2:{ccd_id}"/>
-  
+
   <xs:complexType name="{ccd_id}">
     <xs:complexContent>
-      <xs:restriction base="mlhim2:CCDType">
+    <xs:restriction base="mlhim2:CCDType">
 	<xs:sequence>
 	  <xs:element name="definition"  minOccurs="1"  maxOccurs="1" type="mlhim2:{UUID_definition}"/>
 	</xs:sequence>
-      </xs:restriction>
+    </xs:restriction>
     </xs:complexContent>
   </xs:complexType>
-  
+
   <xs:complexType name="{UUID_definition}">
     <xs:complexContent>
-      <xs:restriction base="mlhim2:{choice}">
+    <xs:restriction base="mlhim2:{choice}">
 	<xs:sequence>
 	  <xs:element name="{choice_dv}"  minOccurs="1"  maxOccurs="1" type="mlhim2:{UUID_DvString}"/>
-	</xs:sequence>
-      </xs:restriction>
+   	</xs:sequence>
+    </xs:restriction>
     </xs:complexContent>
   </xs:complexType>
-  
+
   <xs:complexType name="{UUID_DvString}">
     <xs:complexContent>
       <xs:restriction base="mlhim2:DvStringType">
-	<xs:sequence>
-          <xs:element name="data_name" type="xs:string" minOccurs="1"  maxOccurs="1"/>
-	</xs:sequence>
+	    <xs:sequence>
+          <xs:element name="DvString_dv" type="xs:string" minOccurs="0"  maxOccurs="1"/>
+    	</xs:sequence>
+      <xs:attribute name="data_name" type="xs:string" fixed="{title}"/>
       </xs:restriction>
     </xs:complexContent>
   </xs:complexType>
-  
+
 </xs:schema>
 """.format(ccd_id = ccd_id,
            UUID_definition = UUID_definition,
@@ -102,7 +103,7 @@
            creator = escape(creator),
            contributors = contributors_formated,
            language = language,
-           publisher = escape(publisher), 
+           publisher = escape(publisher),
            subject = escape(subject),
            source = escape(source),
            rights = escape(rights),