Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Replace hithighlight tags [Thread Next] Re: Replace hithighlight tagsTo: NULL Date: 10/7/2005 2:30:00 AM Peter van Schie wrote: > Hi all, > > Give an xml document that looks something like this: > > <?xml version="1.0" encoding="iso-8859-1"?> > <?xml-stylesheet type="text/xsl" > href="http://localhost/archiefassistent/xsl/fulldoc.xsl"?> > <result> > <currentpage>1</currentpage> > <document id="5"> > <fulltext>This module is the <searchhit>third</searchhit> in the > OPPS series. More text...</fulltext> > </document> > </result> > > I'm transforming this document to html to display in a browser. The xml > document is a searchresult and the <searchhit></searchhit> tags > surround the terms that were searched for. Now I'd like to transform > the <searchhit> and </searchhit> tags into something like <span > style="background: red;"> and </span>, to highlight the searchterms in > the resultview. > > Is this possible? And if yes, could you give me some pointers as to > how? Yes, it's possible. Presumably you are parsing the XML to convert it to a DOM document fragment. When you get to a searchhit element, insert a span with the required attributes. If you show how you are parsing the XML, you may get more help... -- Rob | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
