Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9aebd9c52482d3cb2ceba234a00c0ac6bc832f22 (plain) (blame)
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
<!--
	Copyright (c) 2012 CEA LIST.
	All rights reserved. This program and the accompanying materials
	are made available under the terms of the Eclipse Public License 2.0
	which accompanies this distribution, and is available at
	https://www.eclipse.org/legal/epl-2.0/

	SPDX-License-Identifier: EPL-2.0
	
	Contributors:
		Nicolas Bros (Mia-Software)
-->
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
	version="1.0">
	<xsl:param name="newChild" />
	<xsl:param name="newTimestamp" />
	<xsl:output encoding="UTF-8" method="xml" indent="yes" />
	<xsl:strip-space elements="*" />

	<!-- update the timestamp attribute -->
	<xsl:template match="properties/property[@name='p2.timestamp']">
		<property name='p2.timestamp' value='{$newTimestamp}' />
	</xsl:template>

	<!-- add the child composite -->
	<xsl:template match="repository/children">
		<children size='{@size+1}'>
			<xsl:copy-of select="child" />
			<child location='{$newChild}' />
		</children>
	</xsl:template>

	<!-- copy the rest as-is -->
	<xsl:template match="*">
		<xsl:copy>
			<xsl:for-each select="@*">
				<xsl:copy-of select="." />
			</xsl:for-each>
			<xsl:apply-templates />
		</xsl:copy>
	</xsl:template>

</xsl:stylesheet>

Back to the top