1 10 11 package org.mule.transformers.xml; 12 13 import org.mule.umo.transformer.TransformerException; 14 15 18 public class DomDocumentToXml extends AbstractXmlTransformer 19 { 20 23 private static final long serialVersionUID = -6452312203102491187L; 24 25 public DomDocumentToXml() 26 { 27 setReturnClass(String .class); 28 } 29 30 public Object doTransform(Object src, String encoding) throws TransformerException 31 { 32 try 33 { 34 if (byte[].class.equals(returnClass)) 37 return convertToBytes(src, encoding); 38 else 39 return convertToText(src); 40 } 41 catch (Exception e) 42 { 43 throw new TransformerException(this, e); 44 } 45 } 46 47 } 48 | Popular Tags |