Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Use mode="literal" in the JSP tag pega:reference to eliminate leading and trailing spaces

Updated on May 3, 2020


A developer asks: Our application writes the result of an XML rule to a property value using the Property-Set-XML method. 

The result contains the correct property value, but with two leading and trailing spaces around each value. 

What causes these leading and trailing spaces, and what can we do about them?



Suggested Approach

Like HTML rules, XML rules are processed by stream processing. By default during stream processing, property references are padded with a single space before and after the value. 

To eliminate this padding, specify a mode of LITERAL in the reference directive:

{.myproperty literal}

In the JSP reference tag, specify this in the mode attribute.

<pega: reference name="myproperty" mode="literal" />

This works for XML, HTML rendered in a form, and HTML sent out as email or Word correspondence.


Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us