Test Coverage Report

Stylesheet: /build/tests/stubs/delink-wired.xslt

module: /build/tests/stubs/delink-wired.xslt; 15 lines

not used

module: /build/tests/stubs/save-file.stub; 19 lines

01: <?xml version="1.0" encoding="ISO-8859-1"?>
02: <xsl:stylesheet version="2.0"
03:    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
04:    xmlns:archimate="http://www.archimatetool.com/archimate"
05:    xmlns:zenta="http://magwas.rulez.org/zenta"
06:    xmlns:saxon="http://saxon.sf.net/"
07:    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
08: 
09:  	<xsl:function name="zenta:save-file">
10: 		<xsl:param name="path"/>
11: 		<xsl:param name="content"/>
12: 		<result-document>
13: 			<xsl:attribute name="href" select="$path"/>
14: 			<xsl:copy-of select="$content"/>
15: 		</result-document>
16:     </xsl:function>
17: 
18: </xsl:stylesheet>
19: 

module: /build/src/main/resources/xslt/lib/identity.xslt; 19 lines

01: <?xml version="1.0" encoding="ISO-8859-1"?>
02: <xsl:stylesheet version="2.0"
03: 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
04: 
05:   <xsl:template match="@*|*|processing-instruction()|comment()" mode="#all">
06:     <xsl:copy>
07:       <xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()" mode="#current"/>
08:     </xsl:copy>
09:   </xsl:template>
10: 
11:   <xsl:template match="element" mode="changeElementType">
12:      <elementCopy>
13:         <xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()" mode="#current"/>
14:      </elementCopy>
15:   </xsl:template>
16: 
17: </xsl:stylesheet>
18: 
19: 

module: /build/src/main/resources/xslt/lib/delink.xslt; 86 lines

01: <?xml version="1.0" encoding="UTF-8"?>
02: <xsl:stylesheet
03: 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
04: 	version='2.0'
05: 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
06: 	xmlns:zenta="http://magwas.rulez.org/zenta">
07: 
08: 	<xsl:import href="normalizeFilename.xslt"/>
09: 
10: 	<xsl:template match="folder[property/@key='source']" mode="delink">
11: 		<xsl:variable name="outputfile" select="concat($targetdir,'/modelparts/',property[@key='source']/@value)"/>
12: 		<xsl:message select="concat('part ',$outputfile)"/>
13: 		<xsl:variable name="content">
14: 			<modelpart>
15: 				<xsl:copy-of select="@*|documentation|property"/>
16: 			</modelpart>
17: 		</xsl:variable>
18: 		<xsl:copy-of select="zenta:save-file(
19: 			concat($outputfile,'.modelparams'),
20: 			$content
21: 			)"/>
22: 		<xsl:copy-of select="zenta:save-file(
23: 			concat($outputfile,'/modelparams'),
24: 			$content
25: 			)"/>
26: 		<xsl:variable name="index">
27: 			<index>
28: 				<xsl:apply-templates select="*" mode="delinkWrite">
29: 					<xsl:with-param name="outputdir" select="$outputfile"/>
30: 				</xsl:apply-templates>
31: 			</index>
32: 		</xsl:variable>
33: 		<xsl:copy-of select="zenta:save-file(
34: 			concat($outputfile,'/index'),
35: 			$index
36: 			)"/>
37: 	</xsl:template>
38: 
39: 	<xsl:template match="property[@key='source']" mode="delinkWrite"/>
40: 
41: 	<xsl:template match="folder[property/@key='source']" mode="delinkWrite">
42: 		<xsl:apply-templates select="." mode="delink"/>
43: 	</xsl:template>
44: 
45: 	<xsl:template match="folder" mode="delinkWrite">
46: 		<xsl:param name="outputdir"/>
47: 		<xsl:variable name="subdir" select="concat($outputdir,'/',zenta:normalizeFilename(@name))"/>
48: 		<xsl:message select="$subdir"/>
49: 		<xsl:variable name="content">
50: 			<folder>
51: 				<xsl:copy-of select="@*|*[name()!='element' and not(name()='folder') and not(name()='property' and @key='source')]"/>
52: 			</folder>
53: 		</xsl:variable>
54: 		<xsl:copy-of select="zenta:save-file(
55: 			concat($outputdir,'/',@id,'-',zenta:normalizeFilename(@name)),
56: 			$content
57: 			)"/>
58: 		<xsl:variable name="index">
59: 			<index>
60: 			<xsl:apply-templates select="element|folder" mode="delinkWrite">
61: 				<xsl:with-param name="outputdir" select="$subdir"/>
62: 			</xsl:apply-templates>
63: 			</index>
64: 		</xsl:variable>
65: 		<xsl:copy-of select="zenta:save-file(
66: 			concat($subdir,'/index'),
67: 			$index
68: 			)"/>
69: 		<folder>
70: 			<xsl:copy-of select="@id|@name"/>
71: 		</folder>
72: 	</xsl:template>
73: 
74: 	<xsl:template match="element" mode="delinkWrite">
75: 		<xsl:param name="outputdir"/>
76: 		<xsl:copy-of select="zenta:save-file(
77: 			concat($outputdir,'/',@id,'_',zenta:normalizeFilename(@name)),
78: 			.
79: 			)"/>
80: 		<entry>
81: 			<xsl:copy-of select="@id|@name"/>
82: 		</entry>
83: 	</xsl:template>
84: 
85: </xsl:stylesheet>
86: 

module: /build/src/main/resources/xslt/lib/normalizeFilename.xslt; 19 lines

01: <?xml version="1.0" encoding="UTF-8"?>
02: <xsl:stylesheet
03:         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
04:         version='2.0'
05:         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
06:         xmlns:zenta="http://magwas.rulez.org/zenta">
07: 
08:         <xsl:function name="zenta:normalizeFilename">
09:                 <xsl:param name="name"/>
10: 		<xsl:value-of select="substring(
11: 			replace(
12: 				replace($name,'[/\^\?\[\]\(\)]','_'),
13: 				'\s+$',
14: 				''
15: 			),
16: 			1,150)"/>
17:         </xsl:function>
18: </xsl:stylesheet>
19: