I am trying to transfer set of XML files from one FTP location to another. Before the transfer I want to change the contents of the XML file, specifically I am looking to change the value of one node <Practice Code>. The new value need to be picked up from a separate mapping file which will be updated occasionally.
I managed to transfer the files and change the node value, though I just hardcoded the new value, using presave hook. How can I use a separate mapping file to change the value of that node. My mapping file looks like this.
Old Code -> New Code
TESTD03 -> ON-015
TESTD05 -> BC-013
TESTD06 -> BC-010
TESTD07 -> BC-009
TESTD08 -> BC-008
TESTD09 -> BC-007
The XML file format is as below
<?xml version="1.0" encoding="utf-8"?>
I'll appreciate any help or suggestion.
Please sign in to leave a comment.