StAX XML formatting in Java

前端 未结 10 1420
-上瘾入骨i
-上瘾入骨i 2020-11-29 08:06

Is it possible using StAX (specifically woodstox) to format the output xml with newlines and tabs, i.e. in the form:


  
   someData
  &         


        
10条回答
  •  青春惊慌失措
    2020-11-29 09:00

    Not sure about stax, but there was a recent discussion about pretty printing xml here

    pretty print xml from java

    this was my attempt at a solution

    How to pretty print XML from Java?

    using the org.dom4j.io.OutputFormat.createPrettyPrint() method

提交回复
热议问题