Loading ...
Sorry, an error occurred while loading the content.
 

WP and XML (was: WordPerfect 3.5e and Publishers Today)

Expand Messages
  • John Rethorst
    ... There s a remarkable similarity, so it might be remarkably easy to write XML import and export conversions for WordPerfect. It would support conversions
    Message 1 of 8 , Dec 14, 2008
      --- In wordperfectmac@yahoogroups.com, "gary.badcock" <gary.badcock@...> wrote:

      > (By the way, WordPerfect codes and structures look – to my
      > untrained eye at least – to be a lot like XML.)

      There's a remarkable similarity, so it might be remarkably easy to
      write XML import and export conversions for WordPerfect. It
      would support conversions to/from MS Word 2007 for PC and
      2008 for Mac.

      This is going to be my next major WP project. All help gratefully
      accepted. To this end, I've just posted the WP 3.5e file format to
      the Files section here. It contains every formatting code used in the
      program. It would not be hard to have a macro look for codes and
      write the XML equivalents, or vice versa.

      John R.
    • John Rethorst
      I mistakenly uploaded an older version of the format doc. This has now been corrected (4:48 pm 12/14/08).
      Message 2 of 8 , Dec 14, 2008
        I mistakenly uploaded an older version of the format doc. This
        has now been corrected (4:48 pm 12/14/08).


        --- In wordperfectmac@yahoogroups.com, "John Rethorst" <jrethorst@...> wrote:
        >
        > --- In wordperfectmac@yahoogroups.com, "gary.badcock" <gary.badcock@> wrote:
        >
        > > (By the way, WordPerfect codes and structures look – to my
        > > untrained eye at least – to be a lot like XML.)
        >
        > There's a remarkable similarity, so it might be remarkably easy to
        > write XML import and export conversions for WordPerfect. It
        > would support conversions to/from MS Word 2007 for PC and
        > 2008 for Mac.
        >
        > This is going to be my next major WP project. All help gratefully
        > accepted. To this end, I've just posted the WP 3.5e file format to
        > the Files section here. It contains every formatting code used in the
        > program. It would not be hard to have a macro look for codes and
        > write the XML equivalents, or vice versa.
        >
        > John R.
        >


        --- In wordperfectmac@yahoogroups.com, "John Rethorst" <jrethorst@...> wrote:
        >
        > --- In wordperfectmac@yahoogroups.com, "gary.badcock" <gary.badcock@> wrote:
        >
        > > (By the way, WordPerfect codes and structures look – to my
        > > untrained eye at least – to be a lot like XML.)
        >
        > There's a remarkable similarity, so it might be remarkably easy to
        > write XML import and export conversions for WordPerfect. It
        > would support conversions to/from MS Word 2007 for PC and
        > 2008 for Mac.
        >
        > This is going to be my next major WP project. All help gratefully
        > accepted. To this end, I've just posted the WP 3.5e file format to
        > the Files section here. It contains every formatting code used in the
        > program. It would not be hard to have a macro look for codes and
        > write the XML equivalents, or vice versa.
        >
        > John R.
        >
      • tbgibson
        ... Several years ago I wrote very intricate macros that format my documents for Quark (saved WP files as Text Only), so that when they are pulled into Quark
        Message 3 of 8 , Dec 15, 2008
          --- In wordperfectmac@yahoogroups.com, "John Rethorst" <jrethorst@...> wrote:

          > > --- It would not be hard to have a macro look for codes and
          > >write the XML equivalents, or vice versa.

          Several years ago I wrote very intricate macros that format my
          documents for Quark (saved WP files as Text Only), so that when
          they are pulled into Quark they are completely formatted. Among
          other things, they search/replace codes with the proper Quark
          formatting code just as John has suggested. This is why
          Sheepshaver and WP have saved me professionally. So thanks
          again for this excellent, friendly group and the files and
          applications that have been created for us hardcore WP Mac users.

          Tina Gibson Fairfax, Va.
        • gary.badcock
          ... Don t know if I could help, as I am no programmer. However, for what it s worth: We have the WP codes; XML codes are public knowledge. They could
          Message 4 of 8 , Dec 15, 2008
            --- In wordperfectmac@yahoogroups.com, "John Rethorst" <jrethorst@...> wrote:

            > This is going to be my next major WP project. All help gratefully
            > accepted. To this end, I've just posted the WP 3.5e file format to
            > the Files section here. It contains every formatting code used in the
            > program. It would not be hard to have a macro look for codes and
            > write the XML equivalents, or vice versa.
            >
            > John R.

            Don't know if I could help, as I am no programmer. However, for what
            it's worth:

            We have the WP codes; XML codes are public knowledge. They could
            presumably be (largely) matched in a database. The open source
            libwpd might be a help in this.

            Would it be possible to 'merge' a sort of template search and replace
            macro with the contents of such a database: search for x, if found
            replace x with y/ x1 with y1, x2 with y2, etc.? Or alternatively, could
            a macro make calls on a separate list of parallel codes?

            Judging by the contents of the WP Format file posted, it would be
            one long macro.
          • tbgibson
            ... , gary.badcock ... These are a couple of the macros I wrote that tag my files for Quark, using the formatting
            Message 5 of 8 , Dec 16, 2008
              --- In wordperfectmac@yahoogroups.com
              <mailto:wordperfectmac@yahoogroups.com> , "gary.badcock"
              <gary.badcock@...> wrote:
              >

              > Would it be possible to 'merge' a sort of template search and replace
              > macro with the contents of such a database: search for x, if found
              > replace x with y/ x1 with y1, x2 with y2, etc.? Or alternatively,
              > could a macro make calls on a separate list of parallel codes?
              >
              > Judging by the contents of the WP Format file posted, it would be
              > one long macro.


              These are a couple of the macros I wrote that tag my files for Quark,
              using the formatting that my writers did in MS Word. The first is just a
              generic Code for Quark macro; the second is specific to the page of the
              publication I laid out for 16 years (just recently was laid off, but
              found a much-better job!).

              These are very long, so sorry for the length of this message. If anyone
              wants me to send my USA Library file with my macros, I'll be happy to do
              so.--Tina Gibson, Fairfax Va.

              MACRO #1: Code for Quark with Tags

              Display (Off)
              ;
              Home ()
              Find/Change Reset
              Find String ("[Indent]")
              Change String ("[Tab]")
              Change All
              Home ()
              Repeat
              Find Next Code (Forward;Bold On)
              If (FindStatusFlag=1)
              Type (<B>)
              Else
              Assign (Var00;1)
              End If
              Until (Var00=1)
              Home ()
              Repeat
              Find Next Code (Forward;Bold Off)
              If (FindStatusFlag=1)
              Type (<B>)
              Else
              Assign (Var00;2)
              End If
              Until (Var00=2)
              Home ()
              Repeat
              Find Next Code (Forward;Underline On)
              If (FindStatusFlag=1)
              Type (<I>)
              Else
              Assign (Var00;3)
              End If
              Until (Var00=3)
              Home ()
              Repeat
              Find Next Code (Forward;Underline Off)
              If (FindStatusFlag=1)
              Type (<I>)
              Else
              Assign (Var00;4)
              End If
              Until (Var00=4)
              Home ()
              Repeat
              Find Next Code (Forward;Subscript On)
              If (FindStatusFlag=1)
              Type (<->)
              Else
              Assign (Var00;5)
              End If
              Until (Var00=5)
              Home ()
              Repeat
              Find Next Code (Forward;Subscript Off)
              If (FindStatusFlag=1)
              Type (<P>)
              Else
              Assign (Var00;6)
              End If
              Until (Var00=6)
              Home ()
              Repeat
              Find Next Code (Forward;Superscript On)
              If (FindStatusFlag=1)
              Type (<+>)
              Else
              Assign (Var00;7)
              End If
              Until (Var00=7)
              Home ()
              Repeat
              Find Next Code (Forward;Superscript Off)
              If (FindStatusFlag=1)
              Type (<P>)
              Else
              Assign (Var00;8)
              End If
              Until (Var00=8)
              Home ()
              Repeat
              Find Next Code (Forward;Italics On)
              If (FindStatusFlag=1)
              Type (<I>)
              Else
              Assign (Var00;9)
              End If
              Until (Var00=9)
              Home ()
              Repeat
              Find Next Code (Forward;Italics Off)
              If (FindStatusFlag=1)
              Type (<I>)
              Else
              Assign (Var00;10)
              End If
              Until (Var00=10)
              Home ()
              Find/Change Reset
              Find/Change Action (Select Match)
              Find String ("[Hard Return][Tab]")
              Change String ("[Hard Return]@body text:")
              Change All
              Home ()
              Find String ("[Hard Return][Hard Return]")
              Change String ("[Hard Return]@subhead:")
              Change All
              Home ()
              Beep

              --------------------------------------------------

              Macro #2: Code Specific Page Layout

              Display (Off)
              ;
              Home ()
              Smart Quotes (Off)
              Find/Change Reset
              Type (@headline:)
              Find/Change Action (Position After)
              Find String ("[Hard Return][Hard Return]")
              Find
              Delete
              Type (@intro:)
              Home () ;
              Find/Change Reset
              Find/Change Direction (Forward;No Wrap)
              Find/Change Where ({Current Doc})
              Find/Change Match (Partial Word;Case Insensitive;Alphabet
              Insensitive;CharRep Insensitive;{Text Only})
              Find/Change Affect (Affect Case;{Text Only})
              Find/Change Action (Select Match)
              Find String ("[Font:Geneva][Size:12][Language:USA-English][Indent]")
              Change String ("[Font:Geneva][Size:12][Language:USA-English][Tab]")
              Change All
              Home ()
              Find/Change Reset
              Find/Change Direction (Forward;No Wrap)
              Find/Change Where ({Current Doc})
              Find/Change Match (Partial Word;Case Insensitive;Alphabet
              Insensitive;CharRep Insensitive;{Text Only})
              Find/Change Affect (Affect Case;{Text Only})
              Find/Change Action (Select Match)
              Find String ("[Font:Geneva][Size:12][Language:USA-English]***")
              Change String ("[Font:Geneva][Size:12][Language:USA-English]¥ ")
              Change All
              Home ()
              ;
              Repeat
              Find Next Code (Forward;Bold On)
              If (FindStatusFlag=1)
              Type (<B>)
              Else
              Assign (Var00;1)
              End If
              Until (Var00=1)
              Home ()
              Repeat
              Find Next Code (Forward;Bold Off)
              If (FindStatusFlag=1)
              Type (<B>)
              Else
              Assign (Var00;2)
              End If
              Until (Var00=2)
              Home ()
              Repeat
              Find Next Code (Forward;Underline On)
              If (FindStatusFlag=1)
              Type (<I>)
              Else
              Assign (Var00;3)
              End If
              Until (Var00=3)
              Home ()
              Repeat
              Find Next Code (Forward;Underline Off)
              If (FindStatusFlag=1)
              Type (<I>)
              Else
              Assign (Var00;4)
              End If
              Until (Var00=4)
              Home ()
              Repeat
              Find Next Code (Forward;Subscript On)
              If (FindStatusFlag=1)
              Type (<->)
              Else
              Assign (Var00;5)
              End If
              Until (Var00=5)
              Home ()
              Repeat
              Find Next Code (Forward;Subscript Off)
              If (FindStatusFlag=1)
              Type (<->)
              Else
              Assign (Var00;6)
              End If
              Until (Var00=6)
              Home ()
              Repeat
              Find Next Code (Forward;Superscript On)
              If (FindStatusFlag=1)
              Type (<+>)
              Else
              Assign (Var00;7)
              End If
              Until (Var00=7)
              Home ()
              Repeat
              Find Next Code (Forward;Superscript Off)
              If (FindStatusFlag=1)
              Type (<+>)
              Else
              Assign (Var00;8)
              End If
              Until (Var00=8)
              Home ()
              Repeat
              Find Next Code (Forward;Italics On)
              If (FindStatusFlag=1)
              Type (<I>)
              Else
              Assign (Var00;9)
              End If
              Until (Var00=9)
              Home ()
              Repeat
              Find Next Code (Forward;Italics Off)
              If (FindStatusFlag=1)
              Type (<I>)
              Else
              Assign (Var00;10)
              End If
              Until (Var00=10)
              Home ()
              ;
              ;
              Home ()
              Find/Change Reset
              Find String ("[Hard Return][Tab]")
              Change String ("[Hard Return]@body text:")
              Change All
              Home () ;
              Find/Change Reset
              Find String ("[Hard Return][Hard Return]")
              Change String ("[Hard Return]@subhead:")
              Change All
              End ()
              Type ( <P><f"Zapf Dingbats"><c"PANTONE 294 C">n)
              Home ()
              Find/Change Reset
              Find/Change Action (Position Before)
              Find/Change Direction (Forward;No Wrap)
              Find/Change Where ({Current Doc})
              Find/Change Match (Partial Word;Case Insensitive;Alphabet
              Insensitive;CharRep Insensitive;{Text Only})
              Home ()
              Find/Change Reset
              Find String ("<P>@")
              Change String ("@")
              Change All
              Home ()
              Beep





              [Non-text portions of this message have been removed]
            • Paul Cowan
              ... That would be, dare I say it, Insanely Great. At the moment, to import WordPerfect documents into Déjà Vu X for translation, I use a workflow which,
              Message 6 of 8 , Dec 17, 2008
                --- In wordperfectmac@yahoogroups.com, "John Rethorst" <jrethorst@...>
                wrote, quoting others:

                > > (By the way, WordPerfect codes and structures look – to my
                > > untrained eye at least – to be a lot like XML.)
                >
                > There's a remarkable similarity, so it might be remarkably easy to
                > write XML import and export conversions for WordPerfect. It
                > would support conversions to/from MS Word 2007 for PC and
                > 2008 for Mac.
                >
                > This is going to be my next major WP project.

                That would be, dare I say it, Insanely Great.

                At the moment, to import WordPerfect documents into Déjà Vu X for
                translation, I use a workflow which, though it works well, is
                sometimes lossy (WP -> OOo -> DVX -> OOo -> OOo's own MS Word export
                filter -> WP) - especially when there are tables and such in the
                original. But Déjà Vu will happily eat XML. Be great to be able to
                simplify the import/export.

                bye,


                P. (^_^)
              • John Rethorst
                ... We have another macro maven among us! Tina, glad you re here. John R.
                Message 7 of 8 , Dec 17, 2008
                  --- In wordperfectmac@yahoogroups.com, "tbgibson" <tbgibson@...> wrote:

                  > These are a couple of the macros I wrote that tag my files for Quark,
                  > using the formatting that my writers did in MS Word.

                  > [highly sophisticated macro script deleted]

                  We have another macro maven among us! Tina, glad you're here.

                  John R.
                • John Rethorst
                  ... It will be a tree of macros. The first macro will find a code or tag and, depending on the start of its contents, will branch to one or another macro,
                  Message 8 of 8 , Dec 17, 2008
                    --- In wordperfectmac@yahoogroups.com, "gary.badcock" <gary.badcock@...> wrote:
                    > ...
                    > Judging by the contents of the WP Format file posted, it would be
                    > one long macro.

                    It will be a tree of macros. The first macro will find a code or tag and,
                    depending on the start of its contents, will branch to one or another
                    macro, which will in turn branch. This is fast. WP macros were fast back
                    in the day; with today's machines they're on fire.

                    John R.
                  Your message has been successfully submitted and would be delivered to recipients shortly.