comparison software/mpdl-services-new/mpiwg-mpdl-cms/build/classes/de/mpg/mpiwg/berlin/mpdl/cms/transform/highlight.xsl @ 25:e9fe3186670c default tip

letzter Stand eingecheckt
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 21 May 2013 10:19:32 +0200
parents
children
comparison
equal deleted inserted replaced
23:e845310098ba 25:e9fe3186670c
1 <?xml version="1.0"?>
2 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4 <xsl:output method="html" encoding="utf-8"/>
5
6 <xsl:template match="*:hi">
7 <xsl:variable name="type" select="string(@type)"/>
8 <xsl:choose>
9 <xsl:when test="$type = 'elem'">
10 <div style="background-color:#D3D3D3"><xsl:apply-templates/></div>
11 </xsl:when>
12 <xsl:when test="$type = 'hit'">
13 <span style="background-color:#77DD77"><xsl:apply-templates/></span>
14 </xsl:when>
15 <xsl:otherwise>
16 <xsl:apply-templates/>
17 </xsl:otherwise>
18 </xsl:choose>
19 </xsl:template>
20
21 <xsl:template match="*[. except self::*:hi]">
22 <xsl:element name="span">
23 <xsl:attribute name="class"><xsl:value-of select="name()"/></xsl:attribute>
24 <xsl:copy-of select="@*"/>
25 <xsl:apply-templates/>
26 </xsl:element>
27 </xsl:template>
28
29 </xsl:stylesheet>