TransformerFactory factory = TransformerFactory.newInstance();
String xsltSystemId = getCanonicalURL(pageContext, _xsltSystemId);
Source source = getSource(_xslt, xsltSystemId);
Transformer transformer = factory.newTransformer(source);
// transformer.setOutputProperty("omit-xml-declaration", "yes");
for (int i = 0; i < _paramNames.size(); i++) {
String name = _paramNames.get(i);
String value = _paramValues.get(i);
transformer.setParameter(name, value);
}
if (_xml != null)
source = getSource(_xml, getCanonicalURL(pageContext, _xmlSystemId));
else {
BodyContent body = getBodyContent();
TempCharReader tempReader = (TempCharReader) body.getReader();
int ch;
while (Character.isWhitespace((ch = tempReader.read()))) {
}
if (ch >= 0)
tempReader.unread();
source = new StreamSource(tempReader);
if (_xmlSystemId != null)
source.setSystemId(getCanonicalURL(pageContext, _xmlSystemId));
else
source.setSystemId(((HttpServletRequest) pageContext.getRequest()).getRequestURI());
}
Result result;
Node top = null;