pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcarroll6 <sjcarro...@gmail.com>
Subject JSR 223 scripting in scala with Pivot works; except for....
Date Wed, 13 Apr 2011 03:52:01 GMT
I was able to get the Apache Sling JSR 223 implementation fors scala working
with Pivot. All the problems were of my own making and the process of
getting it to work with Pivot is actually very simple. The below is a simple
bxml file I got working except for the following issue. Everything works
fine until I add

for (i <- 0.to(2))
	print(greetStrings.apply(i))

I then get the following error:
org.apache.pivot.serialization.Seria

error
javax.xml.stream.XMLStreamException
: Parse Errorat [row,col]:[21,11]
message: The content of elements must consist of well-formed character data
or markup.

It appears that the <-symbol is being confused for bxml markup. I realize
that I may be again be making a simple mistake somewhere but just want to be
sure if the issue is with Pivot, Sling's scala or most likely my stupid
mistake. Again any pointers would be appreciated. Once I get something
non-trivial working I will try and post a detailed description of how to do
this if you think it will be of general interest.
 


<?xml version="1.0" encoding="UTF-8"?>
<?language scala?>
     
	     
	import org.apache.sling.scripting.scala._
	class Script(arg:ScriptArgs) {
	
		val x : Int = 2
		val y : Int = 3
		val z : Int = 2 * 3
		println(z)	

		val greetStrings = new Array[String](3)
		greetStrings(0) = "Hello"
		greetStrings(1) = ", "
		greetStrings(2) = "world!\n"
		println(greetStrings(0)+greetStrings(2))

		Does not work
		for (i <- 0.to(2))
    		print(greetStrings.apply(i))
	}
	      
	         
		             
		
    
  

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/JSR-223-scripting-in-scala-with-Pivot-works-except-for-tp2814717p2814717.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Mime
View raw message