Hi,

I'm a relative newcomer to generateDS and am excited about the possibilities of 
using it for my application. I am having problems with it however converting to 
the correct types from the xsd to the python data structure. For example I have 
defined an element:

   <xs:element name="AHLeakSA" type="AHLeakSAType" minOccurs="0">
        <xs:annotation>
            <xs:documentation>Fraction of air-handler flow rate that is lost on 
the supply-side of the air-handler.</xs:documentation>
        </xs:annotation>
    </xs:element>

With the simpleType declaration later on as:

   <xs:simpleType name="AHLeakSAType">
        <xs:restriction base="xs:double">
            <xs:minInclusive value="0"/>
            <xs:maxInclusive value="1"/>
        </xs:restriction>
    </xs:simpleType>

However in the code from generateDS, it comes through as a string when I would 
expect a float.

   def buildChildren(self, child_, nodeName_, from_subclass=False):
        if nodeName_ == 'SupplyLeak':
            SupplyLeak_ = child_.text
            self.SupplyLeak = SupplyLeak_
            self.validate_SupplyLeak(self.SupplyLeak)    # validate type 
SupplyLeak
       elif nodeName_ == 'ReturnLeak':
            ReturnLeak_ = child_.text
            self.ReturnLeak = ReturnLeak_
            self.validate_ReturnLeak(self.ReturnLeak)    # validate type 
ReturnLeak
       elif nodeName_ == 'AHLeakSA':
            AHLeakSA_ = child_.text
            self.AHLeakSA = AHLeakSA_
            self.validate_AHLeakSA(self.AHLeakSA)    # validate type AHLeakSA

What am I doing wrong here? I'm using generateds 2.2b.

Thanks for your help,
Noel Merket

------------------------------------------------------------------------------
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to