ASMContentHandler and SAXClassAdapter/SAXCodeAdapter are using asm-xml.dtd. Here is the example of bytecode to bytecode XSLT transformation.
SAXTransformerFactory saxtf = ( SAXTransformerFactory) TransformerFactory.newInstance(); Templates templates = saxtf.newTemplates( xsltSource); TransformerHandler handler = saxtf.newTransformerHandler( templates); handler.setResult( new SAXResult( new ASMContentHandler( outputStream, computeMax))); ClassReader cr = new ClassReader( bytecode); cr.accept( new SAXClassAdapter( handler, cr.getVersion(), false), false);See JAXP and SAX documentation for more detils.
There are few illustrations of the bytecode transformation with XSLT in examples directory. The following XSLT procesors has been tested.
@since ASM 1.4.3
Engine javax.xml.transform.TransformerFactory property jd.xslt jd.xml.xslt.trax.TransformerFactoryImpl Saxon net.sf.saxon.TransformerFactoryImpl Caucho com.caucho.xsl.Xsl Xalan interpeter org.apache.xalan.processor.TransformerFactory Xalan xsltc org.apache.xalan.xsltc.trax.TransformerFactoryImpl