forked from peppolautoriteit-nl/validation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules-overview.xsl
43 lines (38 loc) · 1.32 KB
/
rules-overview.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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:axsl="http://www.w3.org/1999/XSL/Transform" xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<title>Rules overview</title>
</head>
<body>
<table>
<thead>
<tr>
<th>ID</th>
<th>Category</th>
<th>Description</th>
<th>Query</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="//svrl:failed-assert"/>
</tbody>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="svrl:failed-assert[axsl:attribute[@name='flag']/text()='fatal']">
<tr>
<td><xsl:value-of select="substring-before(substring-after(svrl:text, '['), ']')"/></td>
<td><xsl:value-of select="substring-before(substring-after(svrl:text, '['), '-')"/></td>
<td><xsl:value-of select="substring-after(svrl:text, ']-')"/></td>
<td><xsl:choose>
<xsl:when test="string-length(@test) > 256">Long XPath used, check the schematron source</xsl:when>
<xsl:otherwise><xsl:value-of select="@test"/></xsl:otherwise>
</xsl:choose></td>
</tr>
</xsl:template>
<xsl:template match="svrl:failed-assert"></xsl:template>
</xsl:stylesheet>