Remove namespace prefix with sed

前端 未结 2 762
说谎
说谎 2021-01-22 19:27

I want to convert this piece of xml:


  
    Apples
    Bananas
           


        
2条回答
  •  失恋的感觉
    2021-01-22 19:49

    This sed works for your example:

    sed -E 's~(
      
        Apples
        Bananas
      
    
    

    However just a note that sed is not the best tool for parsing HTML/XML. Consider using HTML parsers.

提交回复
热议问题