diff gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java @ 36:ad381cc47217

Format Code to max 80 Chars per Row gnv/trunk@172 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 02 Oct 2009 08:54:13 +0000
parents 4405f31bbc30
children fccf90761825
line wrap: on
line diff
--- a/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java	Fri Oct 02 08:49:18 2009 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java	Fri Oct 02 08:54:13 2009 +0000
@@ -22,43 +22,46 @@
 
 /**
  * @author Tim Englich <tim.englich@intevation.de>
- *
+ * 
  */
 public class XSLTransformer {
     /**
      * the logger, used to log exceptions and additonaly information
      */
     private static Logger log = Logger.getLogger(XSLTransformer.class);
+
     /**
      * Constructor
      */
     public XSLTransformer() {
         super();
     }
-    
-    public String transform(Node toTransform, String encoding, String templateFileName){
+
+    public String transform(Node toTransform, String encoding,
+            String templateFileName) {
         String resultValue = null;
-            try {
-                XMLUtils xmlUtils = new XMLUtils();
-                Source templateSource = new StreamSource(new File(templateFileName));
-                TransformerFactory xformFactory = TransformerFactory.newInstance();
-                Transformer transformer = xformFactory.newTransformer(templateSource);
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                StreamResult scrResult =  new StreamResult(baos);
-                //log.debug(xmlUtils.writeNode2String(toTransform));
-                DOMSource source = new DOMSource(toTransform);
-                transformer.transform(source, scrResult);
-                resultValue = new String(baos.toByteArray(),encoding);
-            } catch (TransformerConfigurationException e) {
-                log.error(e,e);
-            } catch (UnsupportedEncodingException e) {
-                log.error(e,e);
-            } catch (TransformerFactoryConfigurationError e) {
-                log.error(e,e);
-            } catch (TransformerException e) {
-                log.error(e,e);
-            }
-        
+        try {
+            XMLUtils xmlUtils = new XMLUtils();
+            Source templateSource = new StreamSource(new File(templateFileName));
+            TransformerFactory xformFactory = TransformerFactory.newInstance();
+            Transformer transformer = xformFactory
+                    .newTransformer(templateSource);
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            StreamResult scrResult = new StreamResult(baos);
+            // log.debug(xmlUtils.writeNode2String(toTransform));
+            DOMSource source = new DOMSource(toTransform);
+            transformer.transform(source, scrResult);
+            resultValue = new String(baos.toByteArray(), encoding);
+        } catch (TransformerConfigurationException e) {
+            log.error(e, e);
+        } catch (UnsupportedEncodingException e) {
+            log.error(e, e);
+        } catch (TransformerFactoryConfigurationError e) {
+            log.error(e, e);
+        } catch (TransformerException e) {
+            log.error(e, e);
+        }
+
         return resultValue;
     }
 

http://dive4elements.wald.intevation.org