logo       

Escaping cannot be mixed with values: msg#00044

lang.scala

Subject: Escaping cannot be mixed with values

Hello,

I am new to Scala and tried some of the XML examples I found on the net.
One of the examples I began was the "phonebook3" example changing the phone number. I noticed the example did
not work as I expected so I replaced the XML literals to Elem construction style - to get a correct syntax highlighting in JEdit - and this is the part I have a problem with:
---------------------
else // was present and changed
/* original XML literal style code:
<entry>
<name>{ Name }</name>
<phone where={ Where }>{ ch2 }</phone>
</entry>
*/
Elem(null, "entry", Null, TopScope,
/* Elem(null, "name", Null, TopScope, Text(Name)), <- this I could not used together with escaping ch2 */
ch2:_*)
-------------------

The original code attempts to replace the <phone ...> entries but instead embeds the changed <phone ..> entries represented by 'ch2' within a 'dummy' <phone...> entry. The solution to the problem would seem to uncomment the line before the last
-------------------
/* Elem(null, "name", Null, TopScope, Text(Name)), */
-------------------

but then I recieved an error message saying:
-------------------
/phonebook3.scala:59: escaping cannot be mixed with values ch2:_*)
-------------------

True, I wanted to place a name entry followed by the sequence of the new phone numbers stored in 'ch2'.

Can someone help a beginner how to solve this ?

regards,
Balazs









<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise