upload
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
Это архивный репозиторий. Вы можете его клонировать или просматривать файлы, но не вносить изменения или открывать задачи/запросы на слияние.

lufa_module_transform.xslt 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!--
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2013.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. -->
  7. <!-- Atmel Studio framework Module XML transform file -->
  8. <!-- Creates an asf.xml module document from a given manifest list of XML files,
  9. and adds appropriate documentation links by cross-referencing the Doxygen
  10. tag output file to map Doxygen group names to generated filenames. -->
  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. <!-- Store the LUFA Doxygen tag filename mentioned in the root node for later use -->
  14. <xsl:param name="lufa-doxygen-tagfile" select="lufa-manifest/@tagfile"/>
  15. <!-- Store the LUFA Doxygen documentation filename mentioned in the root node for later use -->
  16. <xsl:param name="lufa-doxygen-docfile" select="lufa-manifest/@docfile"/>
  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. <asf xmlversion="1.0">
  22. <xsl:for-each select="xml-source">
  23. <xsl:comment>Sourced from <xsl:value-of select="@filename"/></xsl:comment>
  24. <xsl:apply-templates select="document(@filename)/lufa/asf/*"/>
  25. </xsl:for-each>
  26. </asf>
  27. </xsl:template>
  28. <!-- Recursively match and copy/process all nodes/attributes -->
  29. <xsl:template match="@*|node()">
  30. <xsl:copy>
  31. <xsl:apply-templates select="@*|node()"/>
  32. </xsl:copy>
  33. </xsl:template>
  34. <!-- For Doxygen entry point nodes we need to convert them into help link
  35. nodes instead and add descriptions, so that they show up as links in
  36. Studio correctly -->
  37. <xsl:template match="build[@type='doxygen-entry-point']">
  38. <!-- select-by-config entries should not have a help link -->
  39. <xsl:if test="not(parent::select-by-config)">
  40. <build type="online-help" subtype="module-help-page-append">
  41. <xsl:attribute name="value">
  42. <!-- Extract filename of the HTML file that contains the documentation for this module from the Doxgen tag file -->
  43. <xsl:value-of select="document($lufa-doxygen-tagfile)/tagfile/compound[name=current()/@value]/filename"/>
  44. </xsl:attribute>
  45. </build>
  46. </xsl:if>
  47. <!-- Modules inside a select-by-config entries should not have a help link -->
  48. <xsl:if test="not(parent::module and ../parent::select-by-config)">
  49. <info type="description" value="summary">
  50. <!-- Extract brief description of the module from the Doxygen combined XML documentation file -->
  51. <xsl:value-of select="document($lufa-doxygen-docfile)/doxygen/compounddef[compoundname=current()/@value]/briefdescription/para"/>
  52. </info>
  53. </xsl:if>
  54. </xsl:template>
  55. </xsl:stylesheet>