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

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
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.
Liquid Support Replied
Employee Post Marked As Resolution

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

Reply to Thread