Thank you very much indeed, choroba, for this answer. It took me a while to get back to it and I learned a lot from analyzing your ingenious approach, although the core techniques your are using are still beyond my grasp.
That is why I am not able to mend an unexpected outcome of your script: If more than one matches are found, only one is tagged, and in part only.
If for example @queried = ("he"), the last occurence in the source string (-> tHE lazy dog) is not tagged, and the first occurence (-> tHE ... fox) is only furnished with the closing demarcation "<end query="he"/>".
I keep on trying, but if the necessary correction of the script pops into your mind immediately, I would be grateful for a short hint, i.e. more indebted than I am already are.
In reply to Re^2: LiBXML: New markup while preserving earlier tags?
by Samantabhadra
in thread LiBXML: New markup while preserving earlier tags?
by Samantabhadra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |