Java XML Output - proper indenting for child items

后端 未结 3 1423
再見小時候
再見小時候 2021-02-11 05:50

I\'d like to serialize some simple data model into xml, I\'ve been using the standard java.org.w3c -related code (see below), the indentation is better than no \"OutputKeys.INDE

3条回答
  •  爱一瞬间的悲伤
    2021-02-11 06:16

    import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory
    
    transformer.setOutputProperty(OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, "4");
    

提交回复
热议问题