comparison software/mpdl-services/mpiwg-mpdl-cms/src/de/mpg/mpiwg/berlin/mpdl/cms/transform/pageXml.xsl @ 23:e845310098ba

diverse Korrekturen
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 27 Nov 2012 12:35:19 +0100
parents
children
comparison
equal deleted inserted replaced
22:6a45a982c333 23:e845310098ba
1 <?xml version="1.0"?>
2 <xsl:stylesheet version="2.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:xlink="http://www.w3.org/1999/xlink"
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:dcterms="http://purl.org/dc/terms"
7 xmlns:math="http://www.w3.org/1998/Math/MathML"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns:xhtml="http://www.w3.org/1999/xhtml"
10 exclude-result-prefixes="xsl xlink dcterms math svg xhtml"
11 >
12
13 <xsl:output method="xhtml" encoding="utf-8"/>
14
15 <xsl:param name="echoFiguresDir"></xsl:param>
16 <xsl:param name="echoPageImgDir"></xsl:param>
17
18 <!-- transform to browser like xml display -->
19 <xsl:template match="element()">
20 <xsl:variable name="elementName" select="name()"/>
21 <xsl:variable name="elementPresentation">
22 <xsl:choose>
23 <xsl:when test="element() = node() or text() != ''">
24 <xsl:value-of select="'&lt;'"/>
25 <span class="xml elementName"><xsl:value-of select="$elementName"/></span>
26 <xsl:apply-templates select="attribute()"/>
27 <xsl:value-of select="'&gt;'"/>
28 <xsl:apply-templates select="element()|text()|comment()|processing-instruction()"/>
29 <xsl:value-of select="'&lt;/'"/>
30 <span class="xml elementName"><xsl:value-of select="$elementName"/></span>
31 <xsl:value-of select="'&gt;'"/>
32 </xsl:when>
33 <xsl:otherwise>
34 <xsl:value-of select="'&lt;'"/>
35 <span class="xml elementName"><xsl:value-of select="$elementName"/></span>
36 <xsl:apply-templates select="attribute()"/>
37 <xsl:value-of select="'/&gt;'"/>
38 </xsl:otherwise>
39 </xsl:choose>
40 </xsl:variable>
41 <ul class="xml element">
42 <xsl:sequence select="$elementPresentation"/>
43 </ul>
44 </xsl:template>
45
46 <xsl:template match="attribute()">
47 <xsl:variable name="attributeName" select="name()"/>
48 <span class="xml attributeName">
49 <xsl:value-of select="' '"/>
50 <xsl:value-of select="$attributeName"/>
51 </span>
52 <xsl:value-of select="'=&quot;'"/>
53 <span class="xml attributeValue"><xsl:value-of select="."/></span><xsl:value-of select="'&quot;'"/>
54 </xsl:template>
55
56 <xsl:template match="comment()">
57 <span class="xml comment">
58 <xsl:value-of select="'&lt;!-- '"/><xsl:value-of select="."/><xsl:value-of select="' --&gt;'"/>
59 </span>
60 </xsl:template>
61
62 <xsl:template match="processing-instruction()">
63 </xsl:template>
64
65 <xsl:template match="*:w">
66 <xsl:apply-templates select="*:orig/node()"/>
67 </xsl:template>
68
69 <xsl:template match="*:hi">
70 <xsl:choose>
71 <xsl:when test="@type = 'elem'">
72 <div>
73 <xsl:attribute name="class"><xsl:value-of select="concat('highlight ', @type)"/></xsl:attribute>
74 <xsl:apply-templates/>
75 </div>
76 </xsl:when>
77 <xsl:otherwise>
78 <span>
79 <xsl:attribute name="class"><xsl:value-of select="concat('highlight ', @type)"/></xsl:attribute>
80 <xsl:apply-templates/>
81 </span>
82 </xsl:otherwise>
83 </xsl:choose>
84 </xsl:template>
85
86 </xsl:stylesheet>