code: @Override
      public int doStartTag() throws JspException {
          // set up transformer in the start tag so that nested <param> tags can set parameters directly
          if (xslt == null) {
              throw new JspTagException(Resources.getMessage("TRANSFORM_XSLT_IS_NULL"));
          }
  
          Source source;
          try {
              if (xslt instanceof Source) {
                  source = (Source) xslt;
              } else if (xslt instanceof String) {
                  String s = (String) xslt;
                  s = s.trim();
                  if (s.length() == 0) {
                      throw new JspTagException(Resources.getMessage("TRANSFORM_XSLT_IS_EMPTY"));
                  }
                  source = XmlUtil.newSAXSource(new StringReader(s), xsltSystemId, entityResolver);
              } else if (xslt instanceof Reader) {
                  source = XmlUtil.newSAXSource((Reader) xslt, xsltSystemId, entityResolver);
              } else {
                  throw new JspTagException(Resources.getMessage("TRANSFORM_XSLT_UNSUPPORTED_TYPE", xslt.getClass()));
              }
          } catch (SAXException e) {
              throw new JspException(e);
          } catch (ParserConfigurationException e) {
              throw new JspException(e);
          }
  
          try {
              t = XmlUtil.newTransformer(source, uriResolver);
              t.setURIResolver(uriResolver);
          } catch (TransformerConfigurationException e) {
              throw new JspTagException(e);
          }
          return EVAL_BODY_BUFFERED;
      }
docs: Tag logic