Hi Howard !!

Here is code snippet i use in my current work

XML ( as java string ) + XALAN XSLT processor - one difference i have static
XSL files in server file system and returned for me like a precompiled
stylesheet

if somthing will not be clear mail to list :).

tips at the end of the message.

Regards
Valik.

//

<%@ page import="org.apache.xalan.xslt.*" %>


<%
        sRequest = request;
        sResponse = response;
        sSession = request.getSession(false);

        if (sSession == null)   response.sendRedirect("main?op=restrict");

        System.out.println(" JSP NMSJobTemplateDlg - Getting request");

        ......


        StringBuffer tResultXML = new StringBuffer("");


        tResultXML.append(generateOutputXML());

        logWriter.log(" JSP NMSJobTemplateDlg - output - #### " +
tResultXML.toString() + " ####", logWriter.INFO);


        XSLTProcessor proc = XSLTProcessorFactory.getProcessor();


        WebEnvironment appenv = (WebEnvironment) application.getAttribute( "env" );
        XSLTPool theXSLTPool = (XSLTPool) appenv.getProvider( "XSLTPool" );

        props.clear();
        props.put( "name",
ebUtil.getSingleParameterAsString( params,"opDialogName", "" ) );
        props.put( "path", "jsp/" +
ebUtil.getSingleParameterAsString( params,"opDialogPackageName","" ) );



proc.setStylesheet( (StylesheetRoot)theXSLTPool.getNamedResource("",props) )
;

        proc.process(new XSLTInputSource((new
StringReader(tResultXML.toString()))),
                        null,
                        new XSLTResultTarget(response.getWriter())
                        );
%>


        proc.process(new XSLTInputSource((new
StringReader(tResultXML.toString()))),
                        null,
                        new XSLTResultTarget(response.getWriter()) ;

1 parameter - XML : file or string or input reader
2 parameter - XSL : the same plus if xml contains referense to XSL
stylesheet used it if no and null is passed -> error
2 parameter - output source - thesane as 1

Sorry i don't have time to write more. please refer to xalan docs

again good luck

Vlik



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
  • XML+XSL Howard Lee
    • V.A. Kozhevnykov

Reply via email to