Support Article
Incorrect additional xml tag is added into Correspondence rules
SA-11323
Summary
Incorrect additional xml tag is sometimes added automatically to Correspondence and Fragment rules.
The following tag, "<?xml:namespace prefix = "pega" />", is sometimes added to the XML stream of the rules and this unexpected tag is breaking the PDF generation of the correspondence rules.
Error Messages
No error message just an incorrect tag: "<?xml:namespace prefix = "pega" />".
Steps to Reproduce
- Create a Rule-Corr-Fragment.
- Add plain text and properties.
- Save and checkIn the rule. Observe that the incorrect tag is added to the XML source stream.
Root Cause
Browser adds the XML namespace prefixes with PEGA as there are Pega tags in the content-editable frame.
Resolution
Following is the local-change used to solve this issue.
Create a new “pyPostSave” on the corresponding classes “Rule-Corr-Fragment” and “Rule-Corr” in order to remove the unexpected tag with a regular expression. Mentioned activity is just a single step of Java:
Following is the Java code:
String source = myStepPage.getString("pySourceStream");
//Using Regex to replace XML PEGA namespaces
source = source.replaceAll("(?i)<\\?xml\\s*:\\s*namespace\\s+prefix\\s*=\\s*pega\\s*\\/>","");
myStepPage.getProperty("pySourceStream").setValue(source);
Published July 20, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.