Searching in Oxygen - "Ignore extra white spaces" not working properly

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
B-E-N
Posts: 108

Searching in Oxygen - "Ignore extra white spaces" not working properly

Fri Jan 19, 2018 1:09 pm

Hi,

our XML topics can sometimes contain line breaks or white spaces that somehow influence the Oxygen search function.

For example

I want to search a certain keyword. In the Oxygen Text view, the keyword can look like this:

Code: Select all

<keyword keyref="product_name"
    />

In the search window, I type <keyword keyref="product_name"/> and activate "Ignore extra white spaces". The result shows me some matches for the search term, but not necessarily all matches. I would expect to find all matches for the search term, no matter how many white spaces are included in the term in the topics.

Am I expecting too much from the "Ignore extra white spaces" function? I thought it's intended for this exact use case.

Thanks,

Benjamin
Radu
Posts: 5571

Re: Searching in Oxygen - "Ignore extra white spaces" not working properly

Fri Jan 19, 2018 1:25 pm

Hi Benjamin,

I think your expectations are correct.
If you describe a precise case in which this does not work (paste in a codeblock some DITA content) we could try to fix it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
B-E-N
Posts: 108

Re: Searching in Oxygen - "Ignore extra white spaces" not working properly

Fri Jan 19, 2018 1:44 pm

If I reference the topic (code below) in a ditamap and then use the "Find/Replace in Files" dialog to search for the product name keyword, I get different results depending on how many white spaces I put in the "Text to find" field. "Ignore extra white spaces" is alway activated. Using Oxygen 19.0 with a custom framework.

Wrong search result when searching for:

Code: Select all

<keyword keyref="product_name"/>

Correct search result when searching for:

Code: Select all

<keyword keyref="product_name"
   />


Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="urn:smtg:dita:rng:smtg_concept.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="urn:smtg:dita:rng:smtg_concept.rng" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<concept xml:lang="en-US" id="test_topic_c">
 <title>Test title</title>
 <shortdesc>This is a test.</shortdesc><prolog>
  <author>Test</author>
  <critdates>
   <created date="2017-07-15"/>
   <revised modified="2017-12-21"/>
  </critdates>
 </prolog>
 <conbody>
  <p>Hello how are you <keyword keyref="product_name"
   />, test test test.</p>
  <p><keyword keyref="product_name"
    /> test test test.</p>
 </conbody>
</concept>
Radu
Posts: 5571

Re: Searching in Oxygen - "Ignore extra white spaces" not working properly

Fri Jan 19, 2018 2:48 pm

Hi Ben,

Thanks, I understand now.
Instead of that special checkbox you can probably enable regular expressions and search for <keyword(\s*)keyref="product_name"(\s*)/>.
The "Ignore extra white spaces" basically also uses regular expressions underneath, if you try to search for <keyword keyref="product_name"/> it will try to compose a regular expression looking like this: [b]<keyword(\s+)keyref="product_name"/> so that no matter how many whitespaces are between the keyword and the attribute it will still match them. But it does not do anything about relaxing the match of the "/>" with possible previous white spaces.
I will add an internal issue on our side, maybe based on your example we can improve the behavior.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
B-E-N
Posts: 108

Re: Searching in Oxygen - "Ignore extra white spaces" not working properly

Fri Jan 19, 2018 4:28 pm

That would be nice. Getting more familiar with regular expressions is also a good idea. Thanks for providing an example for this.

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 2 guests