Am 13.12.2011 17:14, schrieb Hussein Shafie: > I'm really sorry but I don't see. The behaviour of webSearch seems > well adapted to the vast majority of use cases. That's why we are > reluctant to modify it.
I agree that almost always, it is desirable to strip off leading and trailing spaces before submitting a search term, so XXE should keep on doing this by default. However, it would be nice if this behaviour could be turned off, e.g. via some parameter in command webSearch. For the time being I can't think of any way to have leading and/or trailing spaces pass through command webSearch. As a workaround, I have developed a kind of monster macro command to catch those cases. Definitely not elegant, but at least no character gets lost when analysing the text selection. Here it is (I am doubting that anyone really would take much interest in it): <property name="WebSearch.searchers"><![CDATA[ Unicode String Analyser http://people.w3.org/rishida/tools/analysestring/index.php?list=${searched} ]]></property> <binding> <keyPressed code="F11" /> <command name="sendCharsToUnicodeStringAnalyser"/> </binding> <!-- Send characters in text selection to Unicode String Analyser, or analyse them immediately if the text selection has leading or trailing spaces --> <command name="sendCharsToUnicodeStringAnalyser"> <macro> <sequence> <get expression="$selectedChars"/> <set variable="chars" expression="%_" plainString="true" /> <choice> <!-- Only spaces --> <sequence> <test expression="matches($selectedChars, '^ +$')"/> <get expression="concat( 'The text selection only consists of character(s):', '

', replace($selectedChars, ' ', 'U+0020 SPACE '), '

', 'No characters will be sent to the Unicode String Analyser.')"/> <command name="alert" parameter="%_" /> </sequence> <!-- Leading and trailing spaces --> <sequence> <test expression="matches($selectedChars, '^ +.*? +$')"/> <set variable="leading_spaces" expression="replace($chars, '(^ +).*', '$1') "/> <set variable="trailing_spaces" expression="replace($chars, '.*?( +$)', '$1') "/> <set variable="remaining_chars" expression="replace(replace($chars, '^ +', ''), ' +$', '')"/> <get expression="concat( 'The text selection starts with character(s):', '

', replace($leading_spaces, ' ', 'U+0020 SPACE '), '

', 'and ends with character(s):', '

', replace($trailing_spaces, ' ', 'U+0020 SPACE '), '

', 'This character sequence in between will be sent to the Unicode String Analyser:', '

', $remaining_chars)"/> <command name="alert" parameter="%_" /> <get expression="$remaining_chars" plainString="true" /> <command name="webSearch" parameter="[Unicode String Analyser] %_"/> </sequence> <!-- Leading spaces only --> <sequence> <test expression="matches($selectedChars, '^ +')"/> <set variable="leading_spaces" expression="replace($chars, '(^ +).*', '$1') "/> <set variable="remaining_chars" expression="replace($chars, '^ +', '')"/> <get expression="concat( 'The text selection starts with character(s):', '

', replace($leading_spaces, ' ', 'U+0020 SPACE '), '

', 'This following character sequence will be sent to the Unicode String Analyser:', '

', $remaining_chars)"/> <command name="alert" parameter="%_" /> <get expression="$remaining_chars" plainString="true" /> <command name="webSearch" parameter="[Unicode String Analyser] %_"/> </sequence> <!-- Trailing spaces only --> <sequence> <test expression="matches($selectedChars, ' +$')"/> <set variable="trailing_spaces" expression="replace($chars, '.*?( +$)', '$1') "/> <set variable="remaining_chars" expression="replace($chars, ' +$', '')"/> <get expression="concat( 'The text selection ends with character(s):', '

', replace($trailing_spaces, ' ', 'U+0020 SPACE '), '

', 'This preceding character sequence will be sent to the Unicode String Analyser:', '

', $remaining_chars)"/> <command name="alert" parameter="%_" /> <get expression="$remaining_chars" plainString="true" /> <command name="webSearch" parameter="[Unicode String Analyser] %_"/> </sequence> <!-- Text selection without the need for special treatment --> <sequence> <get expression="$chars" plainString="true" /> <command name="webSearch" parameter="[Unicode String Analyser] %_"/> </sequence> </choice> </sequence> </macro> </command> Yves -- XMLmind XML Editor Support List [email protected] http://www.xmlmind.com/mailman/listinfo/xmleditor-support

