[XOM-interest] XML pretty printer

Luca Passani passani at eunet.no
Sun Aug 12 16:15:41 EDT 2007


I think I found the problem. When the tag is a <singleton/>, neither 
writeEndTag() nor writeStartTag() are triggered.

is this the correct behavior? assuming it is, which other method can I 
invoke to add my breakLine() also in the case of singletones?

Thanks

Luca

Elliotte Harold wrote:
>
>
> When you pretty print, XOM assumes it can muck with the white space. 
> You could probably override writeEndTag to add an extra line after 
> certain elements. E.g.
>
> protected void writeEndTag(Element element) {
>   super.writeEndTag(element);
>   if (element.getLocalName().equals("device")) {
>     breakLine();
>   }
> }
>
>




More information about the XOM-interest mailing list