forked from clarin-eric/SAML_metadata_QA_validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
svrlt_to_simple_xml.xsl
executable file
·39 lines (39 loc) · 1.15 KB
/
svrlt_to_simple_xml.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
<xsl:stylesheet
version="2.0"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output
encoding="utf-8"
method="xml"
indent="yes"/>
<xsl:strip-space
elements="*"/>
<xsl:template
match="/svrl:schematron-output">
<results>
<xsl:apply-templates/>
</results>
</xsl:template>
<xsl:template
match="svrl:failed-assert/svrl:text">
<result>
<xsl:variable
name="fields"
select="fn:tokenize(text(), '\n+')"/>
<sp>
<xsl:value-of
select="fn:normalize-space($fields[1])"/>
</sp>
<explanation>
<xsl:value-of
select="fn:normalize-space($fields[2])"/>
</explanation>
<requirement>
<xsl:value-of
select="fn:normalize-space($fields[3])"/>
</requirement>
</result>
</xsl:template>
</xsl:stylesheet>