jelly error

Ketan Pandey
Tera Expert

I am getting the below error 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
 
<g:evaluate var="jvar_i"> var i=12; for(;i<4;i++) i </g:evaluate>
${jvar_i}
 
</j:jelly>
 
 
Error
Error at line (4) The content of elements must consist of well-formed character data or markup.
 
KetanPandey_0-1693636865927.png

 

2 ACCEPTED SOLUTIONS

Hello @Ketan Pandey,

kindly add & before lt as &lt; so it is considered as '<' in jelly script.

 

Kindly try following code.

 

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
 
<g:evaluate var="jvar_j"> 
 
for(var j=0;j &lt; 8;j++) 
{j=j+1;}
j;
</g: evaluate>
value ${jvar_j}
 
</j:jelly>

 

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

 

 

View solution in original post

Hello @Ketan Pandey ,

 

You can find out some details regarding the jelly script in the below link.

https://commons.apache.org/proper/commons-jelly/tags.html 

 

View solution in original post

5 REPLIES 5

Maik Skoddow
Tera Patron
Tera Patron

Hi @Ketan Pandey 

as Jelly is nothing else than XML, critical characters within a tag have to be masked. In your case, it is the "<" within the for-loop.

Instead it has to be written as:

for (; i &lt; 4; i++)

Maik 

KetanPandey_0-1693638960592.png

 

 

i followed your instruction ,but its still printing the value as null

 

Could you please suggest, I am learning jelly script

Hello @Ketan Pandey,

kindly add & before lt as &lt; so it is considered as '<' in jelly script.

 

Kindly try following code.

 

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
 
<g:evaluate var="jvar_j"> 
 
for(var j=0;j &lt; 8;j++) 
{j=j+1;}
j;
</g: evaluate>
value ${jvar_j}
 
</j:jelly>

 

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

 

 

Thank You Sunny, Could you please tell me where i can get the operator details