Bug #3790
closedSaxon-JS documentation app search problems
100%
Description
In the documentation app, we search for the supplied search term in all the section documents using substring matching with fn:contains(), but then highlight using regex pattern matching with xsl:analyze-string. Unsurprisingly, this can produce some dodgy results (e.g. searching for "." means all text gets highlighted; searching for "?" results in an uncaught Saxon-JS error "Invalid regular expression /?/").
Related issues
Updated by Debbie Lockett over 6 years ago
- Status changed from New to In Progress
The flag "q" can be used with the regex in xsl:analyze-string to achieve the required result. i.e. (from the Path 3.1 F&O Spec): "All characters in the regular expression are treated as representing themselves, not as metacharacters. In effect, every character that would normally have a special meaning in a regular expression is implicitly escaped by preceding it with a backslash."
Before discovering this flag, I attempted to do the escaping of special characters (as described in the second sentence) explicitly, but hit some problems with Saxon-JS. I'll raise a separate bug.
Updated by Debbie Lockett over 6 years ago
- Status changed from In Progress to Resolved
- Fix Committed on JS Branch 1.0 added
Fix in findtext.xsl stylesheet committed. SEF regenerated and updated online.
Updated by Debbie Lockett over 6 years ago
- Related to Bug #3910: Error using fn:replace() with "q" flag when search string contains "-" character added
Updated by Debbie Lockett about 6 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in JS Release set to Saxon-JS 1.2.0
Bug fix applied in the Saxon-JS 1.2.0 maintenance release.
Please register to edit this issue
Also available in: Atom PDF Tracking page