Hi Adarsh,
Only the get functions have been implemented for the DOM API objects in GatewayScript. Your two choices are
1) Convert your XML to a string using XML.stringify(inputXMLRequest) and use string manipulation
2) Use the transform.xslt async function to execute an xsl stylesheet that would update the XML and return the result.
I'd suggest you open a request for enhancement for the XML DOM create, update, and delete functions within GatewayScript.
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Thu December 16, 2021 01:04 PM
From: Adarsh Thakur
Subject: Update XML Field value using XSLT
Hi All,
I am trying to update XML field value using gateway script was not successful somehow is not able to update the field value
Sample Message :
<Student>
<Name>Adarsh</Name>
<Age>32</Age>
<Student>
This what I wrote in Gateway script but somehow was not able to update the value :
inputXMLRequest.getElementsByTagName('Name').textContent = 'John';
Assuming inputXMLRequest is correctly parsed.
Can anyone please help me how to implement this using XSLT in API conect as I do not have experience in XSLT.
------------------------------
Adarsh Thakur
------------------------------