From: Dom Lachowicz <cinamod@ho...> - 2000-11-27 17:09:39
If I understand what you're doing (which I may or may not...), it seems like
you're trying to accomplish your task the entirely wrong way. What you
probably want to do is to either:
1) Write an XML file mapping your tags to wv's (see the xml directory)
2) [preferable] Hook up 4 callback functions to wv's parser and let that
generate your data representation.
The AbiWord word processor (http://www.abisource.com) does #2 to import word
docs flawlessly to its native format in ~1100 LOC, including comments and
white space. Here is a direct link to the importer class:
wvRTF.c is another example of this and uses about 500 LOC, though RTF
support is less than optimal at the moment. Porting your system to this
would take a day or two probably, + some minimal bug testing. If you can use
the XML file method in your plugin, it would take about 2-3 hours (I wrote
wvABW, wvWML and wvText in ~3 hours total).
>From: "Stefan v. Wachter" <svwa@...>
>Subject: [Wvware-devel] wv Mac Porting Question
>Date: Mon, 27 Nov 2000 15:18:37 +0100
>I am currently working with wv as a basis for implementing a Word import
>filter for a Macintosh text processing program. This filter will be a
>plugIn module under GNU GPL.
>I started with porting wv to MacOS X which is a FreeBSD based OS (in case
>you dont know). Then I ported to MacOS9 using a console for specifying
>input and ouput files.
>Now I m replacing the code for HTML-Generation with our specific function
>calls. I have been looking around quite a long while until I understood
>that the formatting properties are recognized in the macros
>HANDLE_B_CHAR_ELE etc. in wvConfig.c
>There is one thing which I don t understand yet: How do I know (in
>wvBeginCharProp() e.g.) which Properties really changed? Do I really have
>to compare the whole CHP structure with my current values to find the
>changed values? Or do I have to change the earlier code in decode_simple.c
>for recording how the CHP was build?
>Thanks in advance for help,
>Stefan v. Wachter
>Wvware-devel mailing list
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com