elements-finish.xsl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3. <xsl:output method="xml" version="1.0" encoding="utf-8" indent="no"/>
  4. <xsl:template match="*|@*|processing-instruction()">
  5. <xsl:copy>
  6. <xsl:apply-templates select="@*"/>
  7. <xsl:apply-templates/>
  8. </xsl:copy>
  9. </xsl:template>
  10. <xsl:template match="sect1[refentry]">
  11. <xsl:copy>
  12. <xsl:apply-templates select="title"/>
  13. <xsl:apply-templates select="refentry">
  14. <xsl:sort select="refnamediv/refname"/>
  15. </xsl:apply-templates>
  16. </xsl:copy>
  17. </xsl:template>
  18. <xsl:template match="refsect1[title='May be included in:']/para">
  19. <xsl:copy>
  20. <xsl:apply-templates select="literal[not(.=preceding-sibling::literal)]" mode="included">
  21. <xsl:sort select="."/>
  22. </xsl:apply-templates>
  23. </xsl:copy>
  24. </xsl:template>
  25. <xsl:template match="literal" mode="included">
  26. <xsl:copy-of select="."/>
  27. <xsl:choose>
  28. <xsl:when test="position()=last()">
  29. <xsl:text>.</xsl:text>
  30. </xsl:when>
  31. <xsl:otherwise>
  32. <xsl:text>, </xsl:text>
  33. </xsl:otherwise>
  34. </xsl:choose>
  35. </xsl:template>
  36. <xsl:template match="refsect1[title='Attributes:']/variablelist">
  37. <xsl:copy>
  38. <xsl:apply-templates>
  39. <xsl:sort select="term"/>
  40. </xsl:apply-templates>
  41. </xsl:copy>
  42. </xsl:template>
  43. <xsl:template match="refsect1[title='Attributes:']/variablelist[not(*)]">
  44. <para>None.</para>
  45. </xsl:template>
  46. </xsl:stylesheet>