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         <!-- Store the LUFA Doxygen documentation filename mentioned in the root node for later use -->
 
  21         <xsl:param name="lufa-doxygen-docfile" select="lufa-manifest/@docfile"/>
 
  23         <!-- Read manifest list, add a comment to indicate the source filename
 
  24              and then copy/process all ASF nodes in the referenced document -->
 
  25         <xsl:template match="lufa-manifest">
 
  26                 <xsl:comment>This file has been automatically generated from the LUFA Atmel Studio integration XML files.</xsl:comment>
 
  28                 <asf xmlversion="1.0">
 
  29                         <xsl:for-each select="xml-source">
 
  30                                 <xsl:comment>Sourced from <xsl:value-of select="@filename"/></xsl:comment>
 
  31                                 <xsl:apply-templates select="document(@filename)/lufa/asf/*"/>
 
  36         <!-- Recursively match and copy/process all nodes/attributes -->
 
  37         <xsl:template match="@*|node()">
 
  39                         <xsl:apply-templates select="@*|node()"/>
 
  43         <!-- For Doxygen entry point nodes we need to convert them into help link
 
  44              nodes instead and add descriptions, so that they show up as links in
 
  46         <xsl:template match="build[@type='doxygen-entry-point']">
 
  47                 <build type="online-help" subtype="module-help-page-append">
 
  48                         <xsl:attribute name="value">
 
  49                                 <!-- Extract filename of the HTML file that contains the documentation for this module from the Doxgen tag file -->
 
  50                             <xsl:value-of select="document($lufa-doxygen-tagfile)/tagfile/compound[name=current()/@value]/filename"/>
 
  54                 <info type="description" value="summary">
 
  55                         <!-- Extract brief description of the module from the Doxygen combined XML documentation file -->
 
  56                         <xsl:value-of select="document($lufa-doxygen-docfile)/doxygen/compounddef[compoundname=current()/@value]/briefdescription/para"/>