Re: embed jfor

Bertrand Delacretaz <[email protected]> Tue, 18 Feb 2003 14:08:15 +0100
Newsgroups gmane.text.xml.jfor.general
Message-ID <[email protected]>
Hi Madhavan,

Your code looks fine to me at first sight.

Did you try processing the exact same XML file with jfor in 
command-line mode?
This might help you locate the problem.

-Bertrand

>
> ...Here's a part of my code: (I get an error in the line: new 
> Converter(input, writerOut, Converter.createConverterOption());
> The error is related to xml parsing.. e'though xml doc is valid. AM I 
> missing anything?)
>
> import org.jfor.jfor.converter.*;
> import org.xml.sax.InputSource;
> import java.io.Writer;
>
>  public void formatWordDocument(String xmlFileName)
>   {
>
>       Writer writerOut;
>       writerOut = new StringWriter();
>
> 	InputSource input = new InputSource(xmlFileName);
> 	  	  	
> 	  String outputFileName = "c:/fo_export.rtf";
> 	
> 	 try  {
> 	 	
> 	  writerOut.write(outputFileName);
> 	  new Converter(input, writerOut, Converter.createConverterOption());
> 	  writerOut.close();
>
> 	 } catch (Exception ex) {
> 			logger.debug("Error:"+ex.getMessage());
> 			System.out.println(ex.getMessage());
> 	}
>   }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf