0cadefdb1a4fd55d03b8d2dc47bad35ee2e67d9b
[pub/USBasp.git] / LUFA / StudioIntegration / lufa_extension_transform.xslt
1 <!--
2 LUFA Library
3 Copyright (C) Dean Camera, 2012.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 -->
8
9 <!-- Atmel Studio framework Extension XML transform file -->
10
11 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
12 <xsl:output method="xml" omit-xml-declaration="yes"/>
13
14 <!-- Store the LUFA version mentioned in the root node for later use -->
15 <xsl:param name="lufa-version" select="lufa-manifest/@version"/>
16
17 <!-- Read manifest list and then process all FDK nodes in the referenced
18 document -->
19 <xsl:template match="lufa-manifest">
20 <xsl:comment>This file has been automatically generated from the LUFA Atmel Studio integration XML files.</xsl:comment>
21
22 <fdk xml-version="2.0">
23 <xsl:for-each select="xml-source">
24 <xsl:apply-templates select="document(@filename)/lufa/fdk/*"/>
25 </xsl:for-each>
26 </fdk>
27 </xsl:template>
28
29 <!-- Recursively match and copy/process all nodes/attributes -->
30 <xsl:template match="@*|node()">
31 <xsl:copy>
32 <xsl:apply-templates select="@*|node()"/>
33 </xsl:copy>
34 </xsl:template>
35
36 <!-- Update the extension version to the version of LUFA being used -->
37 <xsl:template match="extension/@version">
38 <xsl:attribute name="version">
39 <xsl:value-of select="substring($lufa-version, 1, 2)"/>
40 <xsl:text>.</xsl:text>
41 <xsl:value-of select="substring($lufa-version, 3, 2)"/>
42 <xsl:text>.</xsl:text>
43 <xsl:value-of select="substring($lufa-version, 5, 2)"/>
44 </xsl:attribute>
45 </xsl:template>
46
47 <!-- Update the extension online help URLs to the version of LUFA being
48 used -->
49 <xsl:template match="online-help/*/@baseurl">
50 <xsl:attribute name="baseurl">
51 <xsl:value-of select="current()"/>
52 <xsl:value-of select="$lufa-version"/>
53 <xsl:text>/html/</xsl:text>
54 </xsl:attribute>
55 </xsl:template>
56
57 </xsl:stylesheet>