"illegal start of simple expression" in XML file in Scala

时间:2019-05-22 18:38:02

标签: xml scala

So I am writing a logic for fetching the data from another file in xml in Scala programming language.

I have practiced the logic in Scala worksheet and it works fine but when I write the same logic in XML, it gives me an error saying "illegal start of simple expression".

<expression>
     val date = valueOf("22")
     val splitValues : Array[String] = date.split("/")
     val value1 = "20" + splitValues{2} + (if(splitValues{0}.toInt &lt; "10".toInt) 0 + splitValues{0} else splitValues{0}) + splitValues{1}
     if(value != null &amp;&amp; !value.trim.isEmpty) value
     else value1
</expression>

So I have to convert the date 6/19/19(MMDDYY) in the format of 20190619(YYYYMMDD) for which I have written this logic. I get the correct answer in the worksheet but I get an error in XML. Please guide me on this. Thanks in Advance

0 个答案:

没有答案