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.
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.