<html><head><style type="text/css"><!-- DIV {margin:0px} --></style></head><body><div style="font-family:lucida console, sans-serif;font-size:10pt"><div>I'm interested in building a simple webapp to that will evaluate xpath expressions and return the results in HTML.&nbsp; The tricky part is that I'd like to highlight the result nodes in context of the source document.&nbsp; For example, if I have an XML document that looks like<br><br>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>&lt;a&gt;<br>&nbsp;&nbsp;&nbsp; &lt;b&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;c&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;d/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/c&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/b&gt;<br>&lt;/a&gt;<br><br>and I execute the xpath expression "//d/ancestor::*", I would like to display the results in HTML as follows:<br><br>&lt;strong&gt;&amp;lt; a &amp;gt; &lt;/strong&gt;<br>&nbsp;&nbsp;&nbsp; &lt;strong&gt;&amp;lt; b &amp;gt;
 &lt;/strong&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &lt;strong&gt;&amp;lt; c &amp;gt; &lt;/strong&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; &amp;lt; d &amp;gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &lt;strong&gt;&amp;lt; /c &amp;gt; &lt;/strong&gt;<br>&nbsp;&nbsp;&nbsp; &lt;strong&gt;&amp;lt; /b &amp;gt; &lt;/strong&gt;<br>&lt;strong&gt;&amp;lt; /a &amp;gt; &lt;/strong&gt;<br><br>I started writing my own JDOM XMLOutputter to highlight the result nodes but I'd rather avoid this effort, especially if someone else has already solved this problem.&nbsp; I'd appreciate any insight on this.&nbsp; Thanks.<br><br>-Andrew<br><br>&nbsp; <br><br></div></div></body></html>