1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 | <!-- specify xhtml output -->
|
---|
7 | <xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="yes"/>
|
---|
8 |
|
---|
9 | <!-- this is needed so that whitespace nodes
|
---|
10 | in page/*.xml are not seen as text-keys -->
|
---|
11 | <xsl:strip-space elements="*"/>
|
---|
12 |
|
---|
13 |
|
---|
14 | <xsl:template match="/">
|
---|
15 | <test>
|
---|
16 | <xsl:attribute name="time"><xsl:value-of select="/test/@time"/></xsl:attribute>
|
---|
17 | <xsl:attribute name="id"><xsl:value-of select="/test/@id"/></xsl:attribute>
|
---|
18 | <xsl:attribute name="errors"><xsl:value-of select="count(//*[@succeeded='no'])"/></xsl:attribute>
|
---|
19 | <xsl:choose>
|
---|
20 | <xsl:when test="//*[@succeeded='no']"><xsl:attribute name="passed">no</xsl:attribute></xsl:when>
|
---|
21 | <xsl:otherwise><xsl:attribute name="passed">yes</xsl:attribute></xsl:otherwise>
|
---|
22 | </xsl:choose>
|
---|
23 | <svn-info><xsl:value-of select="/test/svn-info"/></svn-info>
|
---|
24 |
|
---|
25 | <xsl:for-each select="//*[@succeeded='no']">
|
---|
26 | <xsl:call-template name="error"/>
|
---|
27 | </xsl:for-each>
|
---|
28 |
|
---|
29 | </test>
|
---|
30 | </xsl:template>
|
---|
31 |
|
---|
32 | <xsl:template name="error">
|
---|
33 | <error>
|
---|
34 | <location>
|
---|
35 | <node><xsl:value-of select="name()" />( <xsl:for-each select="@*"><xsl:value-of select="name()"/> = '<xsl:value-of select="."/>' </xsl:for-each>)</node>
|
---|
36 | <xsl:for-each select="ancestor::node()">
|
---|
37 | <xsl:sort select="position()" data-type="number" order="descending"/>
|
---|
38 | <xsl:if test="not(name()='')">
|
---|
39 | <node><xsl:value-of select="name()" />
|
---|
40 | <xsl:if test="@*">(
|
---|
41 | <xsl:for-each select="@*">
|
---|
42 | <xsl:value-of select="name()"/> = '<xsl:value-of select="."/>'
|
---|
43 | </xsl:for-each>)
|
---|
44 | </xsl:if>
|
---|
45 | </node>
|
---|
46 | </xsl:if>
|
---|
47 | </xsl:for-each>
|
---|
48 | </location>
|
---|
49 | <message><xsl:value-of select="message"/></message>
|
---|
50 | </error>
|
---|
51 | </xsl:template>
|
---|
52 |
|
---|
53 | </xsl:stylesheet>
|
---|