upload
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

lufa_extension_transform.xslt 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 Extension XML transform file -->
  8. <!-- Creates an extension.xml document from a given manifest list of XML files,
  9. and adds appropriate documentation base URI entries and version
  10. information. -->
  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 version mentioned in the root node for later use -->
  14. <xsl:param name="lufa-version" select="lufa-manifest/@version"/>
  15. <!-- Read manifest list and then process all FDK nodes in the referenced
  16. document -->
  17. <xsl:template match="lufa-manifest">
  18. <xsl:comment>This file has been automatically generated from the LUFA Atmel Studio integration XML files.</xsl:comment>
  19. <extension-container xmlversion="2.0">
  20. <xsl:for-each select="xml-source">
  21. <xsl:apply-templates select="document(@filename)/lufa/extension-container/*"/>
  22. </xsl:for-each>
  23. </extension-container>
  24. </xsl:template>
  25. <!-- Recursively match and copy/process all nodes/attributes -->
  26. <xsl:template match="@*|node()">
  27. <xsl:copy>
  28. <xsl:apply-templates select="@*|node()"/>
  29. </xsl:copy>
  30. </xsl:template>
  31. <!-- Update the extension version to the version of LUFA being used -->
  32. <xsl:template match="extension/@version">
  33. <xsl:attribute name="version">
  34. <xsl:value-of select="substring($lufa-version, 1, 2)"/>
  35. <xsl:text>.</xsl:text>
  36. <xsl:value-of select="substring($lufa-version, 3, 2)"/>
  37. <xsl:text>.</xsl:text>
  38. <xsl:value-of select="substring($lufa-version, 5, 2)"/>
  39. </xsl:attribute>
  40. </xsl:template>
  41. <!-- Update the extension online help URLs to the version of LUFA being
  42. used -->
  43. <xsl:template match="online-help/*/@baseurl">
  44. <xsl:attribute name="baseurl">
  45. <xsl:value-of select="current()"/>
  46. <xsl:value-of select="$lufa-version"/>
  47. <xsl:text>/html/</xsl:text>
  48. </xsl:attribute>
  49. </xsl:template>
  50. <xsl:template match="online-help/index-page/@url">
  51. <xsl:attribute name="url">
  52. <xsl:value-of select="current()"/>
  53. <xsl:value-of select="$lufa-version"/>
  54. <xsl:text>/html/</xsl:text>
  55. </xsl:attribute>
  56. </xsl:template>
  57. </xsl:stylesheet>