Python: How to replace a character in a XML file with a new node?



I want to replace all instances of semicolon ":" in my node below with a new node "<colon/>" as shown below.


I want this:



<shortName>Trigger:Digital Edge:Source</shortName>



to become like this:



<shortName>Trigger<colon/>Digital Edge<colon/>Source</shortName>



I have already tried using search and replace string, but when I get the output all the "< >" change to &lt and &gt . Can anyone please suggest any techniques to do this. Thank You


No comments:

Post a Comment