1 5 package org.exoplatform.commons.xml; 6 7 import org.xmlpull.mxp1_serializer.MXSerializer; 8 9 15 public class ExoXMLSerializer extends MXSerializer{ 16 final static public String INDENTATION = 17 "http://xmlpull.org/v1/doc/properties.html#serializer-indentation" ; 18 final static public String LINE_SEPARATOR = 19 "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator" ; 20 21 public void element(String ns, String tag, String text) throws Exception { 22 if(text == null) return ; 23 startTag(ns, tag); text(text); endTag(ns, tag) ; 24 } 25 26 static public ExoXMLSerializer getInstance() { 27 ExoXMLSerializer ser = new ExoXMLSerializer() ; 28 ser.setProperty(ExoXMLSerializer.INDENTATION, " ") ; 29 ser.setProperty(ExoXMLSerializer.LINE_SEPARATOR, "\n") ; 30 return ser ; 31 } 32 } | Popular Tags |