Close popover

Table of Contents

How to add or remove space characters in stream-processed XML or HTML output


A developer asks:

  1. In a Property-Set step in an activity, I set the value of a text property to a literal constant. I deliberately want multiple spaces in the middle of the string.  When the property value is displayed, the extra spaces are gone.  It appears that Property-Set is trimming multiple spaces down to a single space.  How do I override this behavior?
  1. How do I gain control over spaces and special characters that I want included in correspondence or XML?  For example, I want correspondence to display XfooX where "foo" is the value held in a property. .  If I specify X{.foo}X -- the string appears in the correspondence as "X foo X" with the surrounding spaces that I do not want.

Suggested Approach

Answer 1

The Property-Set method does not remove the extra spaces.  What you see is the result of HTML rendering by the browser. HTML display does not respect multiple spaces unless the non-breaking space entity   is included in the string.

To force HTML display to contain six spaces, include six copies of this entity:

"Hello       World"

Answer 2

Use the NORMAL keyword with your reference directive. For example:

{.myproperty NORMAL}. 

This eliminate the space before and after the property value.  NORMAL also converts special characters such as & to their HTML entity equivalents such as &amp.

Pega Platform 7.1.1 - 8.3.1 Business Architect System Architect Case Management
Suggest Edit

50% found this useful

Have a question? Get answers now.

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