Java : Convert formatted xml file to one line string

前端 未结 10 1400
时光取名叫无心
时光取名叫无心 2020-12-01 04:02

I have a formatted XML file, and I want to convert it to one line string, how can I do that.

Sample xml:



        
10条回答
  •  死守一世寂寞
    2020-12-01 04:33

    Run it through an XSLT identity transform with and

    
    
        
        
        
            
                
            
        
    
    

    It will remove any of the non-significant whitespace and produce the expected output that you posted.

提交回复
热议问题