Hi Chan,

This question should be asked in the cocoon-users mailing list.
Regards,

-- Olivier Billard



Chan Mei Theng wrote:
Hi,

Kindly advise.

I am facing compilation error.

public void convert(InputStream in, OutputStream out)

        throws Exception

{

throw new Error("Unresolved compilation problems: \n\tHSSFSerializer cannot be resolved to a type" + "\n\tHSSFSerializer cannot be resolved to a type\n"

);

Jars Used

cocoon-poi-2.1.9.jar

serializer.jar

xalan.jar

xercesImpl.jar

xml-apis.jar

xsltc.jar

Below is the java source code.

/*

 * Created on Sep 1, 2005

 */

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

// import net.sourceforge.poi.serialization.HSSFSerializer;

import org.apache.cocoon.serialization.HSSFSerializer;

import java.io.*;

import javax.xml.parsers.*;

import org.xml.sax.*;

import org.xml.sax.*;

import org.w3c.dom.*;

import org.apache.xalan.xslt.*;

/**

 * converts an xml stream into an xls stream

 * @author wohlgemuth

 *

 */

public class XML2XLSConverter {

    /**

     * converts an input XML file to an xls file

     *

     * @throws Exception

     *

* @see edu.ucdavis.genomics.metabolomics.binbase.meta.converter.AbstractConverter#convert(java.io.InputStream,

     *      java.io.OutputStream)

     */

    public void convert(InputStream in, OutputStream out) throws Exception {

org.apache.cocoon.serialization.HSSFSerializer hssfSerializer = new org.apache.cocoon.serialization.HSSFSerializer();

hssfSerializer.setOutputStream (new FileOutputStream ("result.xls"));

XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();

                                reader.setContentHandler (hssfSerializer);

reader.parse (new InputSource (new FileInputStream ("gnumeric.xml")));

    }

                /**

     *

     */

    public XML2XLSConverter() {

        super();

    }

public static void main(String[] args) throws FileNotFoundException, Exception {

new XML2XLSConverter().convert(new FileInputStream(args[0]),new FileOutputStream(args[1]));

    }

}

Thanks & Regards

**Chan Mei ***Theng*
/Technical Developer/

**m: +6012 488 4484**

t: +603 2163 7233

f: +603 2163 8233

[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

www.pocketgroup.co.uk <http://www.pocketgroup.co.uk/>

skype ID: mtchan48

*Experts in mobile content and services ***


Reply via email to