Re: RFE: Find/Replace dialog anomalies

Hussein Shafie <[email protected]> Mon, 15 Aug 2022 10:10:03 +0200
Newsgroups gmane.editors.xxe.general
Message-ID <[email protected]>
My answer assume that:

1) you are writing about the "Find and Replace Element" dialog box, that 
is 
http://www.xmlmind.com/xmleditor/_distrib/doc/help/com.xmlmind.xmledit.cmd.xsearch.SearchReplaceDialog.html

and

2) you are using a single XXE main window containing several tabs.
(A "Find and Replace Element" dialog box is associated to the XXE main 
window used to create it.)



On 8/14/22 13:34, Leif H Silli wrote:
> It is great that, since XXE 10.2.0, the Find/Replace dialog window now 
> does not need to be closed between each F/R “session”. However, I have 
> two issues with the functionality - one related to the dialog window 
> behavior and one related to its Replace (and Find?) behaviors. The last 
> issue first:
> 
> Issue 1:
> 
> Use case situation: I work with modular XHTML documents which embed 
> subdocuments via XInclude.
> 
> I used one such modular document as a template for createing 3 more 
> modular documents. Of course, when I copy «modular-A» as «modular-B», 
> the internal links remain the same - and so I had, as a 2nd and 3rd 
> step, to change the pointers (href and xpointer attributes) of the 
> xinclude elements of the new modular documents. Plus I also had to 
> update the id attributes of the subdocuments, to match the xpointer 
> attributes of the modular documents.
> 
> The Find/Replace dialog is very good for this. However, I ran in to a 
> surprise when replacing the href and xpointer content of the xindlude 
> elements.
> 
> As example, in my new Chatper10 document, I had to change - inside @href 
> @xpointer of <xinclude/> the string “C09” to “C10”.
> 
> I simply set the F/R dialog to replace any attribute with the string 
> “C09” to replace that string with “C10”. And then I hit the «Replace 
> all» button.
> 
> But note that before running the F/R dialog command, I de-transcluded 
> all the content of the document. Thus I was able to work on the 
> attributes of the xinclude elements (without the de-transclude step, 
> this would not work, which I guess makes sense).
> 
> When I hit the ”Replace all” button, I, for start, believed that 
> everything worked find. But then I discovered that this only changed the 
> xpointer attribute. The href attributes was left untouched.
> 
> Then I discovered that in order to change the href attributes as well, I 
> simply at to click the ”Replace all“ button one more time (plus that I 
> had to run the command upwards instead of downwards).
> 
> I find it confusing that the “Replace all“ button did not cause all 
> occurrences to be replaced.

It's indeed a bug and we managed to reproduce it using attached XHTML 
files "Including.xhtml", "Included_bq1.xhtml", "Included_bq2.xhtml":

- Attached screenshot "FindReplaceDialogBox1A.png" is before clicking 
"Replace All".

- Attached screenshot "FindReplaceDialogBox1B.png" is after clicking 
"Replace All".

We'll fix this bug in the next version of XXE.




> 
> Issue 2:
> 
> The new non-modal Find/Replace dialog window does not work exactly like 
> other windows. If the window gets in the way, you should not close it, 
> because then its content goes away. You should rather move the window 
> out of the way, and activate the window or tab that you want to work 
> with. This is an issue in and by itself, however this is not what my 
> report is concerned with.

The "History" button is an easy way to restore F/R criteria you have 
already used during the editing session.



> 
> In my case, I needed to work with 3 files at once. I would in each file 
> look for the string “C09” and replace it with what was correct for the 
> current document. This meant that I had to change the Replace string for 
> each document. But before changing the string, I would typically 
> activate the new document I was about to work with. To do so, I clicked 
> the tab I was about to work with. After that I tried to get back to the 
> Find/Replace window, in order to edit the Replace string. I did so, 
> again, by clicking the Find/Replace window. However, the field with the 
> Replace string was impossible to edit. 

Given the fact the "Find and Replace Element" dialog box is not modal, I 
don't see how this could be technically possible. On a Linux box, it 
could be a window manager bug, but I know that you are using a Mac.




> I had to use a shortcut to 
> circulate through all open windows (of XXE) in order to be able to 
> activate the Find/Replace window in such a way that the Replace string 
> field (of ”on Found attributes”) to become editable.
> 
> (After that I found another workaround: Rather than activating the Tab 
> to be edited by clicking inside it, one can simply activate the correct 
> Tab via the «Show next» menu of the «Tab» menu.)
> 
> It is problematic that one has to activate the F/R dialog window in a 
> particular way,  in order to edit it.
> 

I'm sorry but I did not manage to reproduce this second issue on my 
Linux box. See attached screenshot "FindReplaceDialogBox2.png".

I simply clicked the document tab to switch between documents and it 
always worked fine.

For each document/tab, I was able to first change the replacement text 
and then to use "Replace" or "Replace All".


--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support
Including.xhtml (application/xhtml+xml, 408 B) - not displayed
Included_bq1.xhtml (application/xhtml+xml, 277 B) - not displayed
Included_bq2.xhtml (application/xhtml+xml, 278 B) - not displayed
FindReplaceDialogBox1A.png (image/png, 207.5 KB) - not displayed
FindReplaceDialogBox1B.png (image/png, 213.4 KB) - not displayed
FindReplaceDialogBox2.png (image/png, 225.8 KB) - not displayed