OSDN Git Service

Merged gcj-eclipse branch to trunk.
[pf3gnuchains/gcc-fork.git] / libjava / classpath / tools / external / asm / org / objectweb / asm / xml / package.html
1 <html>
2 <!--
3  * ASM XML Adapter
4  * Copyright (c) 2004, Eugene Kuleshov
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. Neither the name of the copyright holders nor the names of its
16  *    contributors may be used to endorse or promote products derived from
17  *    this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29  * THE POSSIBILITY OF SUCH DAMAGE.
30 -->
31 <body>
32 Provides <a href="http://sax.sourceforge.net/">SAX 2.0</a> adapters for ASM 
33 visitors to convert classes to and from XML.
34 These adapters can be chained with other SAX compliant content handlers and 
35 filters, eg. XSLT or XQuery engines. This package is bundled as
36 a separate <tt>asm-xml.jar</tt> library and requires <tt>asm.jar</tt>.
37 <p>
38 <tt>ASMContentHandler</tt> and <tt>SAXClassAdapter/SAXCodeAdapter</tt>
39 are using <a href="asm-xml.dtd">asm-xml.dtd</a>. 
40 Here is the example of bytecode to bytecode XSLT transformation.
41   
42 <pre>
43     SAXTransformerFactory saxtf = ( SAXTransformerFactory) TransformerFactory.newInstance();
44     Templates templates = saxtf.newTemplates( xsltSource);
45
46     TransformerHandler handler = saxtf.newTransformerHandler( templates);
47     handler.setResult( new SAXResult( new ASMContentHandler( outputStream, computeMax)));
48
49     ClassReader cr = new ClassReader( bytecode);
50     cr.accept( new SAXClassAdapter( handler, cr.getVersion(), false), false);
51 </pre>
52
53 See JAXP and SAX documentation for more detils. 
54
55 <p>
56 There are few illustrations of the bytecode transformation with XSLT in
57 examples directory. The following XSLT procesors has been tested.
58
59 <blockquote>
60 <table border="1" cellspacing="0" cellpadding="3">
61 <tr>
62 <th>Engine</td>
63 <th>javax.xml.transform.TransformerFactory property</td>   
64 </tr>
65
66 <tr>
67 <td>jd.xslt</td>
68 <td>jd.xml.xslt.trax.TransformerFactoryImpl</td>   
69 </tr>
70
71 <tr>
72 <td>Saxon</td>
73 <td>net.sf.saxon.TransformerFactoryImpl</td>
74 </tr>
75
76 <tr>
77 <td>Caucho</td>
78 <td>com.caucho.xsl.Xsl</td>   
79 </tr>
80
81 <tr>
82 <td>Xalan interpeter</td>   
83 <td>org.apache.xalan.processor.TransformerFactory</td>
84 </tr>
85
86 <tr>
87 <td>Xalan xsltc</td>
88 <td>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</td>
89 </tr>
90 </table>
91 </blockquote>
92
93 @since ASM 1.4.3
94
95 </body>
96 </html>