datatypes-finish.xsl 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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="refsect1[title='Facets:']">
  11. <xsl:copy>
  12. <title>Data parameters (facets):</title>
  13. <para>
  14. <xsl:call-template name="facets"/>
  15. </para>
  16. </xsl:copy>
  17. </xsl:template>
  18. <xsl:template name="facets">
  19. <xsl:param name="facets" select="concat(normalize-space(translate(para, ',', ' ')), ' ')"/>
  20. <literal>
  21. <xsl:value-of select="substring-after(substring-before($facets, ' '), 'xsd:')"/>
  22. </literal>
  23. <xsl:variable name="next" select="substring-after($facets, ' ')"/>
  24. <xsl:choose>
  25. <xsl:when test="$next='xsd:whiteSpace ' or $next=''">
  26. <xsl:text>.</xsl:text>
  27. </xsl:when>
  28. <xsl:otherwise>
  29. <xsl:text>, </xsl:text>
  30. <xsl:call-template name="facets">
  31. <xsl:with-param name="facets" select="$next"/>
  32. </xsl:call-template>
  33. </xsl:otherwise>
  34. </xsl:choose>
  35. </xsl:template>
  36. <xsl:template match="@id[starts-with(., 'IXT-16')]">
  37. <xsl:attribute name="id">
  38. <xsl:text>IXT-17</xsl:text>
  39. <xsl:value-of select="substring-after(., 'IXT-16')"/>
  40. </xsl:attribute>
  41. </xsl:template>
  42. <xsl:template match="@id[starts-with(., 'ch16')]">
  43. <xsl:attribute name="id">
  44. <xsl:text>ch17</xsl:text>
  45. <xsl:value-of select="substring-after(., 'ch16')"/>
  46. </xsl:attribute>
  47. </xsl:template>
  48. </xsl:stylesheet>