lufa_helpcontentsetup_transform.xslt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!--
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2017.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. -->
  7. <!-- Atmel Studio HV1 Setup XHTML transform file -->
  8. <!-- Updates a helpcontentsetup.msha document to add appropriate version
  9. information. -->
  10. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" version="1.0">
  11. <xsl:output method="xml" omit-xml-declaration="yes"/>
  12. <!-- Need to input the LUFA help package filename for later use -->
  13. <xsl:param name="help-package-filename"/>
  14. <!-- Recursively match and copy/process all nodes/attributes -->
  15. <xsl:template match="node()">
  16. <xsl:copy>
  17. <xsl:copy-of select="@*"/>
  18. <xsl:apply-templates select="node()"/>
  19. </xsl:copy>
  20. </xsl:template>
  21. <!-- Update the LUFA help package file name -->
  22. <xsl:template match="xhtml:div[@class='package']/xhtml:span[@class='name']">
  23. <xsl:copy>
  24. <xsl:copy-of select="@class"/>
  25. <xsl:value-of select="$help-package-filename"/>
  26. </xsl:copy>
  27. </xsl:template>
  28. <xsl:template match="xhtml:div[@class='package']/xhtml:a[@class='current-link']">
  29. <xsl:copy>
  30. <xsl:copy-of select="@class"/>
  31. <xsl:attribute name="href">
  32. <xsl:value-of select="$help-package-filename"/>
  33. </xsl:attribute>
  34. <xsl:value-of select="$help-package-filename"/>
  35. </xsl:copy>
  36. </xsl:template>
  37. </xsl:stylesheet>