lucidsoftware / xtract

A library to make it easy to deserialize XML to user types in scala
Apache License 2.0
60 stars 20 forks source link

Parsing support for Int and Long with extra spaces before and after actual number #27

Closed greatbalin closed 4 years ago

greatbalin commented 4 years ago

The problem is Scala can't parse Int and/or Long numbers from strings with extra spaces. For example "12".toInt will parse 12 successfully but " 12 ".toInt will throw NumberFormatException.

That could be a problem when XML is not quite well formed and tags with numeric value could contain new-line characters, spaces, etc.