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.

50 lines
1.1 KiB

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3. <xsl:template match="/">
  4. <xsl:apply-templates/>
  5. </xsl:template>
  6. <xsl:template match="faqs">
  7. <s1 title="{@title}">
  8. <s2 title="Questions">
  9. <ul>
  10. <xsl:apply-templates select="faq" mode="index"/>
  11. </ul>
  12. </s2>
  13. <br/>
  14. <xsl:apply-templates select="faq"/>
  15. </s1>
  16. </xsl:template>
  17. <xsl:template match="faq" mode="index">
  18. <li>
  19. <link anchor="faq-{position()}">
  20. <xsl:if test="string-length(@title)=0">
  21. <xsl:value-of select="q"/>
  22. </xsl:if>
  23. <xsl:if test="string-length(@title)>0">
  24. <xsl:value-of select="@title"/>
  25. </xsl:if>
  26. </link>
  27. </li>
  28. </xsl:template>
  29. <xsl:template match="faq">
  30. <anchor name="faq-{position()}"/>
  31. <s2 title="{q}">
  32. <xsl:apply-templates select="a"/>
  33. </s2>
  34. </xsl:template>
  35. <xsl:template match="a">
  36. <xsl:apply-templates/>
  37. </xsl:template>
  38. <xsl:template match="@*|node()">
  39. <xsl:copy>
  40. <xsl:apply-templates select="@*|node()"/>
  41. </xsl:copy>
  42. </xsl:template>
  43. </xsl:stylesheet>