A
Andreas W. Wylach
Hi everybody,
I am about implementing a little search engine that searches a phrase
over xml text nodes. I got
that all working fine but what I want as the results is not the
complete text of the textnode,
I would like to make an abstract like result list (such output that
you get with google searches.
For eg
.... I am the <b>substring</b> from a complete text node ...
where "substring" is the search term.
The problem is simple (I think): I want to extract all the text parts
of the complete text node,
where search searchterm is highlighted, surrounded by the text like
30
characters.
I found an intersting post "cut down text" which is almost that what
I
am looking for, but there the
text is just trimmed by x characters.
Is anybody here, that has an "elegant" way to solve that or some
hints
that get me to the solution? I am not able to use regex (would be
nice
though)
My parser is Sablotron so I am restricted to the functions that I
get.
(1.0).
Any help is greatly appreciated.
regards,
Andreas W Wylach
I am about implementing a little search engine that searches a phrase
over xml text nodes. I got
that all working fine but what I want as the results is not the
complete text of the textnode,
I would like to make an abstract like result list (such output that
you get with google searches.
For eg
.... I am the <b>substring</b> from a complete text node ...
where "substring" is the search term.
The problem is simple (I think): I want to extract all the text parts
of the complete text node,
where search searchterm is highlighted, surrounded by the text like
30
characters.
I found an intersting post "cut down text" which is almost that what
I
am looking for, but there the
text is just trimmed by x characters.
Is anybody here, that has an "elegant" way to solve that or some
hints
that get me to the solution? I am not able to use regex (would be
nice
though)
My parser is Sablotron so I am restricted to the functions that I
get.
(1.0).
Any help is greatly appreciated.
regards,
Andreas W Wylach