FM 7.2: Is there a way to Find a cross-ref and Replace it with another cross-ref?

Syed Zaeem Hosain (Syed.Hosain@aeris.net) Syed.Hosain at aeris.net
Thu Jun 21 09:37:29 PDT 2012


Hi, Steve.

Fred's method works well and I use it when the number of changes are relatively low.

However, for large numbers of changes, your method of editing the MIF file is what has worked best (and usually quickest) for me - it has the side benefit of providing a "MIF Flush" that can clean up the .FM files too.

Sometimes, using a simple text editor with global search and replace is easiest for these kinds of actions.

I would only add one additional comment: Start by backing everything (the .FM, .MIF versions, etc.) up carefully and retain that snapshot of the files for a long time, in case something goes awry, or until you have had a chance of verifying the changes!!

I usually just create a sub-folder below the primary location of the book and .fm files, named with the date and why I took that "snapshot", and then saving a copy of all files associated with that document into it. Sometimes, I do the same kind of copy snapshot before I begin a long editing session, in case I decide to discard some work, etc.

Later, I delete these sub-folders ... usually "at the end" once the document is released, etc.  Disk space for these snapshots is relatively inexpensive nowadays. :)

Z

-----Original Message-----
From: framers-bounces at lists.frameusers.com [mailto:framers-bounces at lists.frameusers.com] On Behalf Of Steve Rickaby
Sent: Thursday, June 21, 2012 9:18 AM
To: Fred Ridder; amakeler at gmail.com; framers at lists.frameusers.com
Subject: RE: FM 7.2: Is there a way to Find a cross-ref and Replace it with another cross-ref?

At 11:14 -0400 21/6/12, Fred Ridder wrote:

>If you create one instance of the correct cross-reference, you can copy that to the clipboard, and then do a Find/Change that uses the "By Pasting" option in the Change box. You'll still have to look at each cross-reference you find to see if it is one you need to change, but at least you can paste in the correct x-ref rather than having to reconstruct it manually.

Fred is correct: FrameMaker's 'replace by pasting' is a wonderfully useful feature.

As a wild guess, you could probably also do a global search/replace by saving the file to MIF, opening it in a text editor, identifying the MIF code that specifies the incorrect xref, and replacing it with the correct one. I've not tried this though.

Xrefs in MIF look like this:

To a para with a Heading 1 tag in same file...

   <XRef
    <XRefName `Heading & Page'>
    <XRefSrcText `53801: Heading1: Heading 1'>
    <XRefSrcIsElem No>
    <XRefSrcFile `'>
    <XRefLastUpdate  1340295100 0>
    <Unique 999233>
   > # end of XRef

To another file...

   <XRef
    <XRefName `Heading & Page'>
    <XRefSrcText `53801: Heading1: Heading 1'>
    <XRefSrcIsElem No>
    <XRefSrcFile `<c\>Xref test.fm'>
    <XRefLastUpdate  1340295244 0>
    <Unique 999231>
   > # end of XRef

where the target of the xref is in a file called 'Xref test.fm'. Note that this field is present, but blank, in the first example.

-- 
Steve




More information about the framers mailing list