You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ian Dallas <ia...@users.sourceforge.net> on 2002/10/22 04:35:09 UTC

New Open Source XML Highlighter

I've just released an open source highlighter for XML documents, written in
Java, that works great for Lucene search results. You can download a copy at
http://www.iandallas.com/projects/xmlhighlighter/.

The program uses regular expressions to search a set of DOM nodes and
transparently handles highlighting matches that span multiple elements.

For example, if you had:
<LINE>I am as vigilant</LINE>
  <STAGE-DIRECTION>Enter MESSENGER</STAGE-DIRECTION>
<LINE>as a cat to steal cream</LINE>

You could extract just the <LINE> nodes and the highlighter would correctly
match the phrase "vigilant as a cat".

Highlight events are passed to a user defined highlighter for processing,
and events are generated for each node affected, which makes it easy to
avoid problems with interleaving tags. For example, the
XMLHighlightListenerImpl class included in the release inserts "<B>" tags
around highlighted text, which would produce:

<LINE>I am as <B>vigilant</B></LINE>
  <STAGE-DIRECTION>Enter MESSENGER</STAGE-DIRECTION>
<LINE><B>as a cat</B> to steal cream</LINE>

The current version is 0.8. I'm hoping to release version 1.0 in about a
month, so if anyone has any feature requests, bug reports, etc, I'd love to
hear them.

Thanks,
--ian / iandallas@users.sourceforge.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: New Open Source XML Highlighter

Posted by Dominator <ga...@x-cago.com>.
Can it also be done on html? pdf would also be nice :) I know, I ask to much
:)

"Ian Dallas" <ia...@users.sourceforge.net> wrote in message
news:006301c27973$a4178540$da714142@nyc.rr.com...
> I've just released an open source highlighter for XML documents, written
in
> Java, that works great for Lucene search results. You can download a copy
at
> http://www.iandallas.com/projects/xmlhighlighter/.
>
> The program uses regular expressions to search a set of DOM nodes and
> transparently handles highlighting matches that span multiple elements.
>
> For example, if you had:
> <LINE>I am as vigilant</LINE>
>   <STAGE-DIRECTION>Enter MESSENGER</STAGE-DIRECTION>
> <LINE>as a cat to steal cream</LINE>
>
> You could extract just the <LINE> nodes and the highlighter would
correctly
> match the phrase "vigilant as a cat".
>
> Highlight events are passed to a user defined highlighter for processing,
> and events are generated for each node affected, which makes it easy to
> avoid problems with interleaving tags. For example, the
> XMLHighlightListenerImpl class included in the release inserts "<B>" tags
> around highlighted text, which would produce:
>
> <LINE>I am as <B>vigilant</B></LINE>
>   <STAGE-DIRECTION>Enter MESSENGER</STAGE-DIRECTION>
> <LINE><B>as a cat</B> to steal cream</LINE>
>
> The current version is 0.8. I'm hoping to release version 1.0 in about a
> month, so if anyone has any feature requests, bug reports, etc, I'd love
to
> hear them.
>
> Thanks,
> --ian / iandallas@users.sourceforge.net





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>