Please use

          Transformer transformer=TransformerFactory.newInstance()
                  .newTransformer(new StreamSource(xslInStream));
          transformer.transform(new JDOMSource(xmlsource), new
SAXResult(driver.getContentHandler()));

instead of XSLTInputhandler

-----Original Message-----
From: Adam Shelley [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 21, 2003 2:34 PM
To: [EMAIL PROTECTED]
Subject: RE: url to xml/xsl file in servlet

Hello,

i get the following error:

symbol: contructor XSLTInputHandler (java.io.File,java.io.InputStream)
location: class org.apache.fop.apps.XSLTInputHandler
         new XSLTInputHandler(new File(xmlParam),xslInstream)

Here is the code section:

URL fileOpenServlet = new
URL("http://www.mylocalmachine.net/myxsl.xsl";);
HttpURLConnection servletConnection = (HttpURLConnection)
fileOpenServlet.openConnection();
InputStream xslInStream = servletConnection.getInputStream();
XSLTInputHandler input =
        XSLTInputHandler(new File(xmlParam),xslInStream);
renderXML(input, response);


Note: i have also included 

import java.net.*;

at the top of the code. 

-Adam


-----Original Message-----
From: Jasmin Mehta [mailto:[EMAIL PROTECTED]
Sent: March 21, 2003 11:24 AM
To: [EMAIL PROTECTED]
Subject: RE: url to xml/xsl file in servlet


Sorry, pl re-read the first line of my previous email like this:
How about this? I have created XSL file from the url itself, though on

-----Original Message-----
From: Jasmin Mehta 
Sent: Friday, March 21, 2003 2:21 PM
To: [EMAIL PROTECTED]
Subject: RE: url to xml/xsl file in servlet

How about this? I have created XML file from the url itself, though on
the same server. But I guess should work from other server too.

URL fileOpenservlet = new
URL("http://localhost/MyApplication/stylesheet/example.xsl";);

HttpURLConnection  servletConnection = (HttpURLConnection)
fileOpenservlet.openConnection();
       InputStream xslInStream = servletConnection.getInputStream();

And you can use this xslInStream in 

          Transformer transformer=TransformerFactory.newInstance()
                  .newTransformer(new StreamSource(xslInStream));
          transformer.transform(new JDOMSource(xmlsource), new
SAXResult(driver.getContentHandler()));

I have not done the similar thing with XML input(source). May be you can
do trial and err.

I found in JDOM API, the method 

public void setInputSource(InputSource inputSource)
                    throws UnsupportedOperationExceptionSets the SAX
InputSource to be used for the Source.

May be this can help.

Jasmin




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to