Pages: 1
Author Topic: XMetaL Author Enterprise 5.5 - search and replace string  (Read 91 times)

Posts: 1

« on: June 28, 2017, 08:55:54 PM »

Sorry for the nooby question, but can anyone suggest a search and replace string for the following situation:

I am trying to move the punctuation mark to before the footnote mark throughout an entire document. The XML tags are as follows:

<footnote id="FN1"><label>1</label>footnote text goes here</footnote>.
Derek Read
Program Manager (XMetaL)

Posts: 2481

« Reply #1 on: June 29, 2017, 04:44:23 PM »

I think you can only really do this in Plain Text view, since your id values and the content inside the <label> and the other text is probably different for different <footnote> elements. You can find things using regular expressions but there is no mechanism in this version to leave some portion of what has been found unchanged (the replacement affects everything you find).

So, use Plain Text view and make two separate replacements like this:

Replacement #1:
Find: <footnote
Replace: .<footnote

Replacement #2:
Find: </footnote>.
Replace: </footnote>

The other option would be to write a script. That would involve walking the document using a few different APIs, finding the element in question, checking to see if it has a period before it, if not add one, checking to see if it has a period after it and removing it. Unless you need to do this all the time (or for multiple users) I'd just use the Find described above.
Pages: 1
Jump to: