xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pratt <chr...@planetpratt.com>
Subject RE: problem with XSLTInputHandler(String,String) constructor
Date Fri, 17 Sep 2004 15:55:54 GMT
The new InputStream(String) constructor takes an XML SystemID, not the XML Content.  Try wrapping
your XML content in a StringReader.
  (*Chris*)

Original Message -----------------------
Hi all,
I have problem with XsltInputHandler. I tried with the following code.But
its not working.I worked with XsltInputHandler (file,file)constructor. It
worked fine.Please tell me what is the problem.I want to pass xml and xsl as
string.Please help me.Thanks in advance
 
                                    
                        xsl is a string contains my xsl file
                        xml is a string contains my xml file
 
InputSource is1=new InputSource(xsl);                                   
            InputSource is2=new InputSource(xml);
            
            XSLTInputHandler inputHandler = new XSLTInputHandler(is1,is2);
            //XSLTInputHandler inputHandler = new XSLTInputHandler(xml,xsl);
            ByteArrayOutputStream outStream = new ByteArrayOutputStream(); 
            
            driver.setOutputStream(outStream);
            
            driver.render(inputHandler.getParser(),
inputHandler.getInputSource()); 
            
            byte[] content = outStream.toByteArray();
            res.setContentLength(content.length);
            
            res.setContentType("application/pdf");
          
           res.getOutputStream().write(content);
           res.getOutputStream().flush();
           
           outStream.close();
 
 
//I ALSO TRIED WITH XSLTInputHandler inputHandler = new
XSLTInputHandler(xml,xsl); 
// means XSLTInputHandler(String,String) constructor
 
 
 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Mime
View raw message