Re: using ContentHandler for com.xmlmind.fo.con verter.Converter

Александр Сталь <[email protected]>
Newsgroups gmane.text.xml.xfc.general
Message-ID <[email protected]>
Thank you!
I have no ability to use Converter.convert method because I’m going to use Convrter into my RTFSerialiser for Apache Cocoon 2.2. 
Into Serializer I have no access for Input stream, and I can use Converter as ContentHandler only. 
I’ve tested my Serializer at several different samples and looks like it works without problem.  


Суббота, 27 июля 2013, 12:07 +02:00 от Hussein Shafie <[email protected]>:
>This is not the recommended way to invoke Converter. In other words, 
>this may have worked by pure luck.
>
>Please refer to 
>http://www.xmlmind.com/foconverter/_distrib/doc/user/sample1_java.html
>
>See also
>
>http://www.xmlmind.com/foconverter/_distrib/doc/api/com/xmlmind/fo/converter/Converter.html#setXMLReader (org.xml.sax.XMLReader)
>
>in case you have configured your XMLReader in a specific way.
>
>
>
>Александр Сталь wrote:
>> Hi, I've resolved this problem!
>> I've made my class external by com.xmlmind.fo.converter.Converter and made setOutputStream as public. It works! :)
>
>
>Александр Сталь wrote:
>>
>> I try to use com.xmlmind.fo.converter.Converter as ContentHandler.
>>
>>
>> For example:
>>
>>
>> File infile = new File("C://test.fo");
>>
>> FileInputStream fis = new FileInputStream( infile);
>>
>> Converter converter = new Converter();
>>
>> converter.setProperty("outputFormat", "rtf");
>>
>> converter.setProperty("outputEncoding", "Cp1252");
>>
>> converter.setProperty("imageResolution", "120");
>>
>> XMLReader xmlReader = XMLReaderFactory.createXMLReader();
>>
>> xmlReader.setContentHandler( converter);
>>
>> xmlReader.parse(new InputSource(fis));
>>
>> fis.close();
>>
>> But I have got exception:
>>
>> Exception in thread "main" org.xml.sax.SAXException: no output specified
>>
>> How can I set outputstream to Converter?
>>
>> Thanks.
>
>
>--
>XMLmind FO Converter Support List
>[email protected]
>http://www.xmlmind.com/mailman/listinfo/xfc-support

-- 
Александр Сталь


--
XMLmind FO Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xfc-support
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.