comparison gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java @ 690:254f062e334b

Added JavaDoc. gnv/trunk@908 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 12 Apr 2010 16:45:16 +0000
parents 57fa8019fbdc
children af22fa5567a6
comparison
equal deleted inserted replaced
689:8487581dfe3b 690:254f062e334b
22 import org.apache.log4j.Logger; 22 import org.apache.log4j.Logger;
23 23
24 import org.w3c.dom.Node; 24 import org.w3c.dom.Node;
25 25
26 /** 26 /**
27 * This xsl transformer is used to transform incoming xml documents with the
28 * help of templates into a html representation.
29 *
27 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> 30 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
28 *
29 */ 31 */
30 public class XSLTransformer { 32 public class XSLTransformer {
31 /** 33 /**
32 * the logger, used to log exceptions and additonaly information 34 * the logger, used to log exceptions and additonaly information
33 */ 35 */
41 */ 43 */
42 public XSLTransformer() { 44 public XSLTransformer() {
43 super(); 45 super();
44 } 46 }
45 47
48 /**
49 * Turns <i>toTransform</i> into another format using the template <i>
50 * templateFileName</i> with the <i>encoding</i>. The parameters added in
51 * {@link #addParameter(java.lang.String, java.lang.String)} are available
52 * in the transformer.
53 *
54 * @param toTransform The node to be transformed.
55 * @param encoding The encoding to be used.
56 * @param templateFileName The template used for transformation.
57 * @return the transformed document as string.
58 */
46 public String transform(Node toTransform, String encoding, 59 public String transform(Node toTransform, String encoding,
47 String templateFileName) { 60 String templateFileName) {
48 String resultValue = null; 61 String resultValue = null;
49 try { 62 try {
50 //XMLUtils xmlUtils = new XMLUtils(); 63 //XMLUtils xmlUtils = new XMLUtils();
77 90
78 return resultValue; 91 return resultValue;
79 } 92 }
80 93
81 94
95 /**
96 * Add a parameter that is required in the XSL sheet.
97 *
98 * @param name The name of the parameter.
99 * @param value The value of the parameter.
100 */
82 public void addParameter(String name, String value) { 101 public void addParameter(String name, String value) {
83 if (params == null) { 102 if (params == null) {
84 params = new HashMap<String, String>(3); 103 params = new HashMap<String, String>(3);
85 } 104 }
86 105
87 params.put(name, value); 106 params.put(name, value);
88 } 107 }
89 } 108 }
109 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org