How do I use HTML reserved character in GEL script

Document ID : KB000012596
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

How to use reserved character (HTML) in CA PPM GEL Script

Question:

How do I output less than (<) sign by using <gel:out> tag in GEL script. 

During validating sample GEL script, the error occurs as below.

BPM-0703: Custom script syntax error at line 4, column 46: The value of attribute "value" associated with an element type "core:set" must not contain the '<' character.

 

The less than (<) sign which is HTML reserved character seems not to be used in GEL script.

How do I use it in GEL script and how do I output '<Hello>' string?

 

Sample code:

<gel:script 

  xmlns:core="jelly:core"

  xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary">

  <core:set var="hello_output_string" value="<Hello>"/>

  <gel:out>${hello_output_string}</gel:out>

</gel:script>

 

Environment:
CA PPM all versions
Answer:

Some characters are reserved in GEL script.

If you use the less than (<) sign in GEL script, GEL parser might mix them with tags.

You can use Character entity to display reserved characters.

 

Character entity format is below:

&entity_name;    OR   &#entity_number;

 

To output less than (<) sign , you can use &lt; or &#60;

 

Sample code should be modified below.

 

Sample code:

<gel:script 

  xmlns:core="jelly:core"

  xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary">

  <core:set var="hello_output_string" value="&lt;Hello&gt;"/>

  <gel:out>${hello_output_string}</gel:out>

</gel:script>



 

Additional Information:

Useful HTML Character Entities:

HTML characterDescriptionEntity nameEntity Number
<less than&lt;&#60;
>greater than&gt&#62;
&ampersand&amp;&#38;
"double quotation mark&quot;&#34;

 

Related knowledge:

https://www.ca.com/us/services-support/ca-support/ca-support-online/knowledge-base-articles.TEC1429448.html