3      Copyright (C) Dean Camera, 2013.
 
   5   dean [at] fourwalledcubicle [dot] com
 
   9 <!-- Atmel Studio framework Module XML transform file -->
 
  11 <!-- Creates an asf.xml module document from a given manifest list of XML files,
 
  12      and adds appropriate documentation links by cross-referencing the Doxygen
 
  13      tag output file to map Doxygen group names to generated filenames. -->
 
  14 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
  15         <xsl:output method="xml" omit-xml-declaration="yes"/>
 
  17         <!-- Store the LUFA Doxygen tag filename mentioned in the root node for later use -->
 
  18         <xsl:param name="lufa-doxygen-tagfile" select="lufa-manifest/@tagfile"/>
 
  20         <!-- Read manifest list, add a comment to indicate the source filename
 
  21              and then copy/process all ASF nodes in the referenced document -->
 
  22         <xsl:template match="lufa-manifest">
 
  23                 <xsl:comment>This file has been automatically generated from the LUFA Atmel Studio integration XML files.</xsl:comment>
 
  25                 <asf xmlversion="1.0">
 
  26                         <xsl:for-each select="xml-source">
 
  27                                 <xsl:comment>Sourced from <xsl:value-of select="@filename"/></xsl:comment>
 
  28                                 <xsl:apply-templates select="document(@filename)/lufa/asf/*"/>
 
  33         <!-- Recursively match and copy/process all nodes/attributes -->
 
  34         <xsl:template match="@*|node()">
 
  36                         <xsl:apply-templates select="@*|node()"/>
 
  40         <!-- For Doxygen entry point nodes we need to convert them into help link
 
  41              nodes instead, so that they show up as links in Studio correctly -->
 
  42         <xsl:template match="build[@type='doxygen-entry-point']">
 
  43                 <xsl:call-template name="add_help_nodes">
 
  44                     <xsl:with-param name="filename" select="document($lufa-doxygen-tagfile)//compound[name=current()/@value]/filename"/>
 
  48         <!-- Generate additional help nodes from the given help filename -->
 
  49         <xsl:template name="add_help_nodes">
 
  50                 <xsl:param name="filename"/>
 
  52                 <build type="online-help" subtype="module-help-page-append">
 
  53                         <xsl:attribute name="value">
 
  54                             <xsl:value-of select="$filename"/>