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 < and > . Can anyone please suggest any techniques to do this. Thank You 回答1: The idea is to get the node text, split it by colon