Write file tool - to get the specific values written to the file
Hi there,
I have a scenario where I need to write the outgoing response (xml ) of a responder to a file. I tried the write file option but it writes the whole xml response to the file. I am just wondering if there is a way where I could get only specific values from the xml to the file? or how could I read only specific values from the xml file?
Thanks in advance
Tagged:
0
Comments
This is one of the ways to accomplish your goal:
Hi Saranya,
EDIT: If you're wanting to write the request XML to a file, follow the below, otherwise use Keegan's suggestion.
An alternative to the above would be to use chained tools to grab the appropriate values and write them to a file. For example, I recommend using an XML Transformer to grab all of the values you wish to write to a file, and then chain the write file tool to the XML Transformer.
Doing so will create the file you are looking for with the values that you are expecting.
One thing to note: The XML Transformer creates new lines as \n, so Windows' default notepad will not recognize new lines (notepad only recognizes \r\n). Instead, use a text editor like notepad++ or sublime to view the output in the correct format. Alternatively, you can also write a short script that will correct this for use in notepad.
Hope this helps!