My favorites
|
Sign in
officepipes
XML Pipelines for Office Documents
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
r2
Source path:
svn
/
trunk
/
odf-compare
/
style-diffs.xsl
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0"?>
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:template match="/">
<xsl:variable name="print-a" select="(//fingerprint)[1]"/>
<xsl:variable name="print-b" select="(//fingerprint)[2]"/>
<xsl:variable name="package-a" select="(//fingerprint)[1]/@package-url"/>
<xsl:variable name="package-b" select="(//fingerprint)[2]/@package-url"/>
<xsl:variable name="docelem" select="/*"/>
<html>
<head>
<title>ODF Fingerprint Difference Report</title>
<style type="text/css"> tr.green td {background:#cfc;} tr.red td {background:#fcc;}</style>
</head>
<body>
<h1>ODF Fingerprint Difference Report</h1>
<p>Between packages <tt>
<xsl:value-of select="$package-a"/>
</tt> and <tt>
<xsl:value-of select="$package-b"/>
</tt>.</p>
<xsl:for-each select="distinct-values(//namespace/@name)">
<xsl:variable name="ns" select="."/>
<br/>
<table border="1" width="80%">
<tbody>
<tr>
<td colspan="3"> For Namespace <tt>
<xsl:value-of select="$ns"/>
</tt></td>
</tr>
<tr>
<td>
<i>element name</i>
</td>
<td width="50%">
<xsl:value-of select="$package-a"/>
</td>
<td width="50%">
<xsl:value-of select="$package-b"/>
</td>
</tr>
<xsl:for-each select="distinct-values($docelem//namespace[@name=$ns]/element/@name)">
<xsl:variable name="lname" select="."/>
<xsl:variable name="num-in-a"
select="number($print-a/namespace[@name=$ns]/element[@name=$lname]/@count)"/>
<xsl:variable name="num-in-b"
select="number($print-b/namespace[@name=$ns]/element[@name=$lname]/@count)"/>
<tr>
<xsl:attribute name="class">
<xsl:value-of select="if ($num-in-a eq $num-in-b) then 'green' else 'red'"/>
</xsl:attribute>
<td>
<xsl:value-of select="$lname"/>
</td>
<td>
<xsl:value-of select="if (string($num-in-a) eq 'NaN') then '0' else $num-in-a"/>
</td>
<td>
<xsl:value-of select="if (string($num-in-b) eq 'NaN') then '0' else $num-in-b"/>
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:transform>
Show details
Hide details
Change log
r2
by alex.brown.gb on Jun 14, 2009
Diff
[No log message]
Go to:
/trunk/odf-compare
...odf-compare/make-fingerprint.xsl
/trunk/odf-compare/odfcompare.xml
/trunk/odf-compare/style-diffs.xsl
/trunk/odf-validate
...nk/odf-validate/odf-validate.xml
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 2971 bytes, 73 lines
View raw file
Hosted by