Problem - Parsing strings

Help
JManuel
2010-01-28
2013-04-15
  • JManuel

    JManuel - 2010-01-28

    We've been using Erlsom for a long time with major success so far but we found a small inconvenience when trying to parse strings (type xs:string in our base XSD):

    If the value of the element is a number of blank spaces or some tabs, without any "visible char" we'll lose them in the translation. Example:
    <ParameterInfoStruct><Name>    </Name><Writable>false</Writable></ParameterInfoStruct>
    Will turn into:
    {'ParameterInfoStruct',,,false}

    The curious part happens when the opposite operation doesn't fail as expected. Example:
    {'ParameterInfoStruct',,"    ",false}
    Turns into
    <ParameterInfoStruct><Name>    </Name><Writable>false</Writable></ParameterInfoStruct>

    It's not a real problem as long as we can keep it under control (filtering those strange cases) but it would be great to know if this is an expected behaviour.

    Thanks.

     
  • Willem de Jong

    Willem de Jong - 2010-01-28

    Hi,

    I'll look into it.

    Regards,
    Willem

     
  • Willem de Jong

    Willem de Jong - 2010-01-31

    I fixed this. The fix is in the github repository, together with some other improvements - http://github.com/willemdj/erlsom.

    The whitespace will now be included in the value of the element. Note: it doesn't work 100% for mixed types.

     
  • JManuel

    JManuel - 2010-02-01

    Hi,

    Thank you for your fast response, we'll update to the repository version and work from it.

    Best regards,
    Jose.

     

Log in to post a comment.