CA API Management: Add or Remove XML Element(s) Assertion sample policy

Document ID : KB000071692
Last Modified Date : 01/03/2018
Show Technical Document Details
Introduction:
Attached is a simple sample policy demonstrating the use of the Add or Remove XML Element(s) Assertion.
The Add or Remove XML Element(s) assertion is used to add or remove XML element to or from a target message
Instructions:

To test this policy:

1. Create a testing endpoint on your Gateway, i.e: /addXml , /removeXml
2. Import the attached policy into the respective endpoint
3. Send one of the sample messages below to the Gateway depending on your needs (add or remove)

Additional Information:
Sample XML for removing the PRICE element:

<bookstore>
<book category="API">
   <title lang="en">CA API Management</title>
   <author>John Doe</author>
   <year>2017</year>
   <price>30.00</price>
</book>
</bookstore>
Remove XML


Sample XML for adding the PRICE element:
<bookstore>
<book category="API">
   <title lang="en">CA API Management</title>
   <author>John Doe</author>
   <year>2017</year>
</book>
</bookstore>

Add XML
File Attachments:
AddRemoveXML.zip