-
Notifications
You must be signed in to change notification settings - Fork 0
/
XSLTFile1.xslt
47 lines (45 loc) · 1.62 KB
/
XSLTFile1.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="@* | node()">
<html>
<head>
<style>
.tableStyle {font-family: Arial; border: 1 solid #808080; font-size: 12;}
.tableHeader {font-size: 14; background-color: #51B0F5; color:white}
</style>
</head>
<body>
<table class="tableStyle" width="80%">
<tr class="tableHeader">
<xsl:for-each select="/*/node()">
<xsl:if test="position()=1">
<xsl:for-each select="*">
<td style="padding:5; text-align:center">
<b><xsl:value-of select="local-name()"/></b>
</td>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</tr>
<xsl:for-each select="*">
<xsl:variable name="rowColour">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">#D4EBFA</xsl:when>
<xsl:otherwise>#BCE4F5</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr bgcolor="{$rowColour}">
<xsl:for-each select="*">
<td style="padding-left:2; padding-right:5">
<xsl:value-of select="." />
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
<br/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>