Convert an xml element whose content is inside CDATA

前端 未结 3 1368
轮回少年
轮回少年 2020-12-01 21:56

I have a xml fragment like below


    welcome to my page
3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 22:31

    You can't "remove" the CDATA, but you can achieve the desired output somewhat crudely:

    
    
    
       
            
            
            
            
            
       
    
    
    

    This will work for the first type of div you're trying to parse and you can follow something similar with the second one. It could be made more generic with some effort.

提交回复
热议问题