How can I find and replace text in XML using Perl?

后端 未结 3 1285
天涯浪人
天涯浪人 2021-01-15 06:33

My XML file looks something like this:


    
        
               
             


        
3条回答
  •  有刺的猬
    2021-01-15 07:06

    Grab an XML parser off the CPAN and use it. They're there for a reason.

    Once you've done that, it's some fairly simple XPath expressions to get the nodes you want, and then some quick text replacement on the specific attributes themselves.

提交回复
热议问题