rtf2xml docbook version error

  • Rainer M. Egle
    Rainer M. Egle

    Tried to run rtf2xml-.4 but running into a problem.

    Mac OS X 10.2.8, Cocoon/Xalan installed.
    PyXML-0.8.3 installed

    <configuration-directory path = "/etc/">
    <xslt-processor processor = "xalan"/>

    while python configure.py build, I received an error-message that parser.setfeature....
    NameError: global name 'False' not defined.
    I replaced false with 0 (zero). "Python ... build" and "python ... install" complete now.
    Now I am getting the message that "xalan" appears to be working on my system.

    I can generate a raw XML, but no simplified docbook version

    Following is a cut and paste from my console:

    [administrators-Computer:webdev/rtf2xml-.4/scripts] root# ./rtf2xml --output testdoc.xml testdoc.rtf
    [administrators-Computer:webdev/rtf2xml-.4/scripts] root#
    [administrators-Computer:webdev/rtf2xml-.4/scripts] root# ./rtf2xml -o testdoc.xml --format sdoc testdoc.rtf
    Traceback (most recent call last):
      File "./rtf2xml", line 248, in ?
      File "./rtf2xml", line 231, in Handle_Main
        exit_level = parse_obj.parse_rtf()
      File "/usr/lib/python2.2/site-packages/rtf2xml/ParseRtf.py", line 467, in parse_rtf
      File "/usr/lib/python2.2/site-packages/rtf2xml/post_process.py", line 344, in convert
      File "/usr/lib/python2.2/site-packages/rtf2xml/post_process.py", line 56, in __default_convert
        self.__do_default_convert(convert_head = 1, convert_list = 1)
      File "/usr/lib/python2.2/site-packages/rtf2xml/post_process.py", line 66, in __do_default_convert
        action(temp_in, trans_dict)
      File "/usr/lib/python2.2/site-packages/rtf2xml/post_process.py", line 159, in __convert_lists_func
        result = self.__list_outside(temp_list)
      File "/usr/lib/python2.2/site-packages/rtf2xml/post_process.py", line 217, in __list_outside
        result = list_obj.make_lists()
      File "/usr/lib/python2.2/site-packages/rtf2xml/transform/make_lists.py", line 274, in make_lists
    NameError: global name 'False' is not defined
    [administrators-Computer:webdev/rtf2xml-.4/scripts] root#

    I am no python programmer so my question to you: Is it OK to replace that False in line 274 with a 0?

    Thank you


    • Hi Rainer

      Sorry I am so late in getting back to you. I had no idea that
      anyone had even downloaded my script.

      I am not sure about the above error. The python iplementation of SAX tends to be buggy.

      The newest version of the script does not require the use of SAX at all. The newest version is much easier to install and use.

      The newest version does *not* convert directly to sdocbook. However, a conversion to sdoc should be very easy with a simple xslt stylesheet. I have not written such a stylesheet yet, but plan on writing a stylesheet in the next week or so.

      In order to write an xslt stylesheet to convert raw XML to sdocbook, I only need to make minor modifications to the current xslt stylesheet.

      I hope this helps. If you have any questions, you can email me at my home email address (phthenry@earthlink.net).