XSD enum don't preserve trailing whitespaces
Problem reported by Simon Liang - October 3 at 9:46 AM
Resolved
My xsd file has below definition:
<xs:element name="XXX">
    <xs:simpleType>
        <xs:restriction base="xs:string">
            <xs:enumeration value="abc  "/>
        </xs:restriction>
    </xs:simpleType>
</xs:element>

The generated C# codes include the two whitespaces after abc, however when I deserialise the xml file with XXX's value with "abc  ", it reports error as below:

An unhandled exception of type 'LiquidTechnologies.XmlObjects.LxSerializationException' occurred in LiquidTechnologies.XmlObjects.Runtime.dll: 'The value of the element XXX@... can not be read into property LiquidTechnologies.GeneratedLx.Tns....XXX. The value 'abc' could not be converted to the enumeration type LiquidTechnologies.GeneratedLx.Tns...XXXEnum'
   at LiquidTechnologies.XmlObjects.LxReaderSettings.DefaultErrorHandler(String msg, LxErrorSeverity severity, LxErrorCode errorCode, TextLocation location, Object targetObject)

Could you guide me how to handle the situation that enum include tailing whitespace?

Thanks very much!

3 Replies

Reply to Thread
0
Liquid Support Replied
Employee Post
Thanks for your feedback, I can confirm this is an issue and it will be resolved in the next point release soon.
1
Liquid Support Replied
Employee Post Marked As Resolution
Hi,

This fix is now available in v18.0.15:
0
Simon Liang Replied
Thanks for your support :-)

Reply to Thread