public TransformSupport() { super(); init(); }
public int doStartTag() throws JspException { // evaluate any expressions we were passed, once per invocation evaluateExpressions(); // chain to the parent implementation return super.doStartTag(); }
@Override public void release() { super.release(); xmlExpression = null; xmlSystemIdExpression = null; xsltExpression = null; xsltSystemIdExpression = null; resultExpression = null; }
Source getSource(Reader reader, String systemId) throws JspTagException { try { XMLReader xr = XMLReaderFactory.createXMLReader(); xr.setEntityResolver(new ParseSupport.JstlEntityResolver(pageContext)); xr.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); InputSource s = new InputSource(reader); s.setSystemId(wrapSystemId(systemId)); Source result = new SAXSource(xr, s); result.setSystemId(wrapSystemId(systemId)); return result; } catch (SAXException e) { throw new JspTagException(e); } }
Source source = getSource(xml, xmlSystemId);
public int doEndTag() throws JspException { Tag t = findAncestorWithClass(this, TransformSupport.class); if (t == null) throw new JspTagException( Resources.getMessage("PARAM_OUTSIDE_TRANSFORM")); TransformSupport parent = (TransformSupport) t; Object value = this.value; if (value == null) { if (bodyContent == null || bodyContent.getString() == null) value = ""; else value = bodyContent.getString().trim(); } parent.addParameter(name, value); return EVAL_PAGE; }
} else if (o instanceof String) { return getSource(new StringReader((String) o), systemId); } else if (o instanceof Reader) { xr.setEntityResolver(new ParseSupport.JstlEntityResolver(pageContext)); InputSource s = new InputSource((Reader) o); s.setSystemId(wrapSystemId(systemId)); Source result = new SAXSource(xr, s); result.setSystemId(wrapSystemId(systemId)); return result; } else if (o instanceof Node) { return getSource(l.get(0), systemId); // unwrap List } else { throw new IllegalArgumentException(Resources.getMessage("TRANSFORM_SOURCE_INVALID_LIST"));
Source source = getSource(xml, xmlSystemId);
public int doEndTag() throws JspException { Tag t = findAncestorWithClass(this, TransformSupport.class); if (t == null) throw new JspTagException( Resources.getMessage("PARAM_OUTSIDE_TRANSFORM")); TransformSupport parent = (TransformSupport) t; Object value = this.value; if (value == null) { if (bodyContent == null || bodyContent.getString() == null) value = ""; else value = bodyContent.getString().trim(); } parent.addParameter(name, value); return EVAL_PAGE; }
} else if (o instanceof String) { return getSource(new StringReader((String) o), systemId); } else if (o instanceof Reader) { new ParseSupport.JstlEntityResolver(pageContext)); InputSource s = new InputSource((Reader) o); s.setSystemId(wrapSystemId(systemId)); Source result = new SAXSource(xr, s); result.setSystemId(wrapSystemId(systemId)); return result; } else if (o instanceof Node) { return getSource(l.get(0), systemId); // unwrap List } else { throw new IllegalArgumentException(
public TransformSupport() { super(); init(); }
Source source = getSource(xml, xmlSystemId);
public int doStartTag() throws JspException { // evaluate any expressions we were passed, once per invocation evaluateExpressions(); // chain to the parent implementation return super.doStartTag(); }
public void release() { super.release(); init(); }
public int doEndTag() throws JspException { Tag t = findAncestorWithClass(this, TransformSupport.class); if (t == null) throw new JspTagException( Resources.getMessage("PARAM_OUTSIDE_TRANSFORM")); TransformSupport parent = (TransformSupport) t; Object value = this.value; if (value == null) { if (bodyContent == null || bodyContent.getString() == null) value = ""; else value = bodyContent.getString().trim(); } parent.addParameter(name, value); return EVAL_PAGE; }
} else if (o instanceof String) { return getSource(new StringReader((String) o), systemId); } else if (o instanceof Reader) { new ParseSupport.JstlEntityResolver(pageContext)); InputSource s = new InputSource((Reader) o); s.setSystemId(wrapSystemId(systemId)); Source result = new SAXSource(xr, s); result.setSystemId(wrapSystemId(systemId)); return result; } else if (o instanceof Node) { return getSource(l.get(0), systemId); // unwrap List } else { throw new IllegalArgumentException(
public void release() { init(); }
Source source = getSource(xml, xmlSystemId);
public int doStartTag() throws JspException { // evaluate any expressions we were passed, once per invocation evaluateExpressions(); // chain to the parent implementation return super.doStartTag(); }
public void release() { super.release(); init(); }