File: README.brazil

package info (click to toggle)
libxalan2-java 2.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 19,468 kB
  • ctags: 26,006
  • sloc: java: 175,784; xml: 28,073; sh: 164; jsp: 43; makefile: 43; sql: 6
file content (55 lines) | stat: -rw-r--r-- 2,144 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
============================================================
CONTENTS OF THIS DOCUMENT:

  o) HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
  o) HOW TO INVOKE TRANSLETS FROM A BRAZIL HANDLER

------------------------------------------------------------
HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE

This sample code illustrates how Xalan/XSLTC can be used to
offer XSL transformations as a web service without using a
full web server. We have chosen to use the Brazil prototype
for the web interface, available from Sunlabs:
    http://www.sun.com/research/brazil/
but we could easily have used some other web interface such
as Tomcat. The supplied Java code implements a Brazil
"handler", which very much resembles a servlet.

The CompiledEJB and CompiledServlet sample code
demonstrate other approaches to providing XSL transformations
as a web service.

------------------------------------------------------------
HOW TO INVOKE TRANSLETS FROM A BRAZIL HANDLER

The CompiledBrazil directory contains the example source code:

    TransformHandler.java

This file contains a minimal implementation of an XSL
transformation handler.  You can find a precompiled version
in xsltcbrazil.jar.

Compile any stylesheets you're interested in into translets.
Set your CLASSPATH to include xalan.jar, xercesImpl.jar,
xml-apis.jar, your translet classes and the Brazil server
jar file.

You can now set up the Brazil server to service requests by
using the following command:

$ java -Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl \
       sunlabs.brazil.server.Main -port 8080 \
       -handler TransformHandler

In a browser, you can enter a URI similar to the following:

  http://localhost:8080/?translet=myTrans&document=myDoc

where "myTrans" is the URI of a stylesheet that you've
compiled into a translet and "myDoc" is URI of an XML document
you'd like to process using that stylesheet.  The result of
the transformation will be displayed in your browser.
------------------------------------------------------------
END OF README