Kumar AU

Kumar AU

  • 1.1k
  • 309
  • 61.9k

How to remove space in XML template, If there is no value p

May 2 2017 10:28 PM
I have a XML template (Its a receipt) - which has the following lines :-
Never share any information about this transaction with any third party other than your intended receiver
<left requires="SenderFullName">{SenderFullName}</left><br requires="SenderFullName"/>
<left requires="ReceiverFullName">{ReceiverFullName}</left><br requires="ReceiverFullName"/>
<left requires="ReceiverCountry"> {ReceiverCountry}</left><br requires="ReceiverCountry"/>
<left requires="AccountId">{AccountId}</left><br requires="AccountId"/>
For delivery times , please refer to the Terms and Conditions
Through Programatically I pass these values for the lines that are in {} to XML template.But sometimes when there are no values for these fileds, it is creating 4 lines of spaces for these fields and continuing with rest of the lines.My requirement is that I don't want to get the empty spaces for the fields that do not have values. Between 1st line and last line If there are values are passed from Program, Could you please help me how do I do that.

Attachment: Image.zip

Answers (1)