I'm using JAXB marshaller to create and format my .xml file. It works pretty well, except one place. The indentation lacks in two places:
<Elem1>
<Elem2>
<Elem3 ID="Elem3.INFO">
<Elem4>INFO</Elem4>
</Elem3>
<Elem2>
<Elem3 ID="Elem3.TEMPLATE">
<Elem4>TEMPLATE</Elem4>
</Elem3>
</Elem2>
<Elem2>
<Elem3 ID="Elem3.LEVEL">
<Elem4>LEVEL</Elem4>
</Elem3>
</Elem2>
</Elem2>
</Elem1>
The rest of the .xml file looks good. I'm using this method to prettify whole code:
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
Unfortunatelly it doesn't works for these two elements.
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…