1 16 17 package org.apache.taglibs.standard.tag.el.xml; 18 19 import javax.servlet.jsp.JspException ; 20 import javax.xml.transform.Result ; 21 22 import org.apache.taglibs.standard.tag.common.xml.TransformSupport; 23 import org.apache.taglibs.standard.tag.el.core.ExpressionUtil; 24 25 31 public class TransformTag extends TransformSupport { 32 33 36 private String xml_; private String xmlSystemId_; private String xslt_; private String xsltSystemId_; private String result_; 42 43 46 public TransformTag() { 47 super(); 48 init(); 49 } 50 51 52 55 public int doStartTag() throws JspException { 57 58 evaluateExpressions(); 60 61 return super.doStartTag(); 63 } 64 65 66 public void release() { 68 super.release(); 69 init(); 70 } 71 72 73 76 public void setXml(String xml_) { 78 this.xml_ = xml_; 79 } 80 81 public void setXmlSystemId(String xmlSystemId_) { 83 this.xmlSystemId_ = xmlSystemId_; 84 } 85 86 public void setXslt(String xslt_) { 88 this.xslt_ = xslt_; 89 } 90 91 public void setXsltSystemId(String xsltSystemId_) { 93 this.xsltSystemId_ = xsltSystemId_; 94 } 95 96 102 103 public void setResult(String result_) { 105 this.result_ = result_; 106 } 107 108 109 112 private void init() { 114 xml_ = xmlSystemId = xslt_ = xsltSystemId_ = result_ = null; 116 } 117 118 119 private void evaluateExpressions() throws JspException { 120 127 128 xml = ExpressionUtil.evalNotNull( 129 "transform", "xml", xml_, Object .class, this, pageContext); 130 xmlSystemId = (String ) ExpressionUtil.evalNotNull( 131 "transform", "xmlSystemId", xmlSystemId_, String .class, 132 this, pageContext); 133 xslt= ExpressionUtil.evalNotNull( 134 "transform", "xslt", xslt_, Object .class, this, 135 pageContext); 136 xsltSystemId = (String ) ExpressionUtil.evalNotNull( 137 "transform", "xsltSystemId", xsltSystemId_, String .class, 138 this, pageContext); 139 result = (Result ) ExpressionUtil.evalNotNull( 140 "transform", "result", result_, Result .class, this, pageContext); 141 142 } 143 } 144 | Popular Tags |