job-helper.xsl 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. version="1.0">
  4. <xsl:output method="text"/>
  5. <xsl:param name="property"/>
  6. <xsl:template match="/">
  7. <xsl:variable name="prop" select="job/property[@name = $property]"/>
  8. <xsl:choose>
  9. <xsl:when test="$prop">
  10. <xsl:apply-templates select="$prop/*"/>
  11. </xsl:when>
  12. <xsl:when test="$property = 'canditopicslist'">
  13. <xsl:apply-templates select="job/files/file[@non-conref-target = 'true']"/>
  14. </xsl:when>
  15. <xsl:when test="$property = 'codereflist'">
  16. <xsl:apply-templates select="job/files/file[@has-coderef = 'true']"/>
  17. </xsl:when>
  18. <xsl:when test="$property = 'conreflist'">
  19. <xsl:apply-templates select="job/files/file[@has-conref = 'true']"/>
  20. </xsl:when>
  21. <xsl:when test="$property = 'conrefpushlist'">
  22. <xsl:apply-templates select="job/files/file[@conrefpush = 'true']"/>
  23. </xsl:when>
  24. <xsl:when test="$property = 'conreftargetslist'">
  25. <xsl:apply-templates select="job/files/file[@conref-target = 'true']"/>
  26. </xsl:when>
  27. <xsl:when test="$property = 'copytosourcelist'">
  28. <xsl:apply-templates select="job/files/file[@copy-to-source = 'true']"/>
  29. </xsl:when>
  30. <xsl:when test="$property = 'flagimagelist'">
  31. <xsl:apply-templates select="job/files/file[@flag-image = 'true']"/>
  32. </xsl:when>
  33. <xsl:when test="$property = 'fullditamaplist'">
  34. <xsl:apply-templates select="job/files/file[@format = 'ditamap']"/>
  35. </xsl:when>
  36. <xsl:when test="$property = 'fullditamapandtopiclist'">
  37. <xsl:apply-templates select="job/files/file[(@format = 'ditamap' or @format = 'dita')]"/>
  38. </xsl:when>
  39. <xsl:when test="$property = 'fullditatopiclist'">
  40. <xsl:apply-templates select="job/files/file[@format = 'dita']"/>
  41. </xsl:when>
  42. <xsl:when test="$property = 'hrefditatopiclist'">
  43. <xsl:apply-templates select="job/files/file[@has-link = 'true']"/>
  44. </xsl:when>
  45. <xsl:when test="$property = 'hreftargetslist'">
  46. <xsl:apply-templates select="job/files/file[@target = 'true']"/>
  47. </xsl:when>
  48. <!-- Deprecated since 2.2 -->
  49. <xsl:when test="$property = 'htmllist'">
  50. <xsl:apply-templates select="job/files/file[@format = 'html']"/>
  51. </xsl:when>
  52. <!-- Deprecated since 2.2 -->
  53. <xsl:when test="$property = 'imagelist'">
  54. <xsl:apply-templates select="job/files/file[@format = 'image']"/>
  55. </xsl:when>
  56. <xsl:when test="$property = 'keyreflist'">
  57. <xsl:apply-templates select="job/files/file[@has-keyref = 'true']"/>
  58. </xsl:when>
  59. <xsl:when test="$property = 'outditafileslist'">
  60. <xsl:apply-templates select="job/files/file[@out-dita = 'true']"/>
  61. </xsl:when>
  62. <xsl:when test="$property = 'resourceonlylist'">
  63. <xsl:apply-templates select="job/files/file[@resource-only = 'true']"/>
  64. </xsl:when>
  65. <xsl:when test="$property = 'subjectschemelist'">
  66. <xsl:apply-templates select="job/files/file[@subjectscheme = 'true']"/>
  67. </xsl:when>
  68. <xsl:when test="$property = 'subtargetslist'">
  69. <xsl:apply-templates select="job/files/file[@subtarget = 'true']"/>
  70. </xsl:when>
  71. <xsl:otherwise>
  72. <xsl:message terminate="yes">ERROR: Unrecognized property '<xsl:value-of select="$property"/>'</xsl:message>
  73. </xsl:otherwise>
  74. </xsl:choose>
  75. </xsl:template>
  76. <xsl:template match="set">
  77. <xsl:for-each select="string">
  78. <xsl:if test="not(position() = 1)"><xsl:text>&#xA;</xsl:text></xsl:if>
  79. <xsl:apply-templates select="."/>
  80. </xsl:for-each>
  81. </xsl:template>
  82. <xsl:template match="string">
  83. <xsl:value-of select="."/>
  84. </xsl:template>
  85. <xsl:template match="file">
  86. <xsl:if test="not(position() = 1)"><xsl:text>&#xA;</xsl:text></xsl:if>
  87. <xsl:value-of select="@path"/>
  88. </xsl:template>
  89. </xsl:stylesheet>