I'm trying to chain multiple XSL transforms together using the Oracle XSLProcessor.
The first transform runs fine. The second transform also appears to run, but does not change the output at all.
This is the code I'm using for the first transform.
private static XMLDocumentFragment Transform(InputStream xslt_stream, InputStream src_xml_stream) throws XSLException, MalformedURLException{
XSLProcessor proc = new XSLProcessor();
XSLStylesheet stylesheet = proc.newXSLStylesheet(xslt_stream);
XMLDocumentFragment frag = proc.processXSL(stylesheet, src_xml_stream, null);
return frag;
}
I take the output of that transform and pipe it into the second method.
private static XMLDocumentFragment Transform(InputStream xslt_stream, XMLDocumentFragment src_frag) throws XSLException, MalformedURLException{
XSLProcessor proc = new XSLProcessor();
XSLStylesheet stylesheet = proc.newXSLStylesheet(xslt_stream);
XMLDocumentFragment frag = proc.processXSL(stylesheet, src_frag);
return frag;
}
Here is the flow.
// get XSL input stream from ZD
xslt_stream = getFromZD(conn, "SELECTFF", zd_xslt_chain_1);
// first overload
XMLDocumentFragment transformed = Transform(xslt_stream, xml_stream);
if (zd_xslt_chain_2 != null){
// run second in transform chian
xslt_stream = getFromZD(conn, "SELECTFF", zd_xslt_chain_2);
// second overload
transformed = Transform(xslt_stream, transformed);
}
Am I doing something obviously wrong and is there a better way to run an XSLT chain? Lets pretend like I have use Oracle's XSL processor, because I do.