Dear Dave,

We are having a problem with exporting an element with a set default value.
The element in question is
<xs:element name="framesPerImage" type="xs:integer" default="1">
    <xs:annotation>
        <xs:documentation>Normally = 1.
Relevant for multi-frame direct electron detectors.</xs:documentation>
    </xs:annotation>
</xs:element>

It seems to be exported only when its value is not equal to the default one
if self.framesPerImage != 1:
    showIndent(outfile, level, pretty_print)
outfile.write('<%sframesPerImage>%s</%sframesPerImage>%s' % (namespace_, self.gds_format_integer(self.framesPerImage, input_name='framesPerImage'), namespace_, eol_))

As a result, xmllint fails to validate the exported XML since it is missing framesPerImage element.

Please could you tell if there is a switch that could force exports of elements if they have a default value? The relevant code seems to be starting at line 2080
        if default is None:
            wrt('%s        if self.%s is not None:\n' % (fill, mappedName, ))
        else:
            wrt('%s        if self.%s != %s:\n' % (
                fill, mappedName, default, ))

Many thanks and best regards,
Andrii

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to