Add Atmel Studio integration files.
[pub/lufa.git] / LUFA / StudioIntegration / lufa_module_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 Module 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 Doxygen tag filename mentioned in the root node for later use -->
15 <xsl:param name="lufa-doxygen-tagfile" select="lufa-manifest/@tagfile"/>
16
17 <!-- Read manifest list, add a comment to indicate the source filename
18 and then copy/process all ASF nodes in the referenced 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 <asf xmlversion="1.0">
23 <xsl:for-each select="xml-source">
24
25 <xsl:text>&#xA;&#xA;</xsl:text>
26 <xsl:comment>Sourced from <xsl:value-of select="@filename"/></xsl:comment>
27 <xsl:text>&#xA;</xsl:text>
28
29 <xsl:apply-templates select="document(@filename)/lufa/asf/*"/>
30
31 <xsl:if test="position()=last()">
32 <xsl:text>&#xA;&#xA;</xsl:text>
33 </xsl:if>
34
35 </xsl:for-each>
36 </asf>
37 </xsl:template>
38
39 <!-- Recursively match and copy/process all nodes/attributes -->
40 <xsl:template match="@*|node()">
41 <xsl:copy>
42 <xsl:apply-templates select="@*|node()"/>
43 </xsl:copy>
44 </xsl:template>
45
46 <!-- For Doxygen entry point nodes we need to convert them to add additional
47 help link nodes so that they show up as links in Studio correctly -->
48 <xsl:template match="build[@type='doxygen-entry-point']">
49 <xsl:copy-of select="current()"/>
50
51 <xsl:call-template name="add_help_nodes">
52 <xsl:with-param name="filename" select="document($lufa-doxygen-tagfile)//compound[name=current()/@value]/filename"/>
53 </xsl:call-template>
54 </xsl:template>
55
56 <!-- Generate additional help nodes from the given help filename -->
57 <xsl:template name="add_help_nodes">
58 <xsl:param name="filename"/>
59
60 <build type="online-help" subtype="module-help-page-append">
61 <xsl:attribute name="value">
62 <xsl:value-of select="$filename"/>
63 </xsl:attribute>
64 </build>
65
66 <build type="offline-help" subtype="module-help-page-append">
67 <xsl:attribute name="value">
68 <xsl:value-of select="$filename"/>
69 </xsl:attribute>
70 </build>
71 </xsl:template>
72
73 </xsl:stylesheet>