axf.xsl 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  4. xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
  5. version='1.0'>
  6. <!-- ********************************************************************
  7. $Id: axf.xsl 8983 2011-03-27 07:41:25Z mzjn $
  8. ******************************************************************** -->
  9. <xsl:template name="axf-document-information">
  10. <xsl:variable name="authors" select="(//author|//editor|
  11. //corpauthor|//authorgroup)[1]"/>
  12. <xsl:if test="$authors">
  13. <xsl:variable name="author">
  14. <xsl:choose>
  15. <xsl:when test="$authors[self::authorgroup]">
  16. <xsl:call-template name="person.name.list">
  17. <xsl:with-param name="person.list"
  18. select="$authors/*[self::author|self::corpauthor|
  19. self::othercredit|self::editor]"/>
  20. </xsl:call-template>
  21. </xsl:when>
  22. <xsl:when test="$authors[self::corpauthor]">
  23. <xsl:value-of select="$authors"/>
  24. </xsl:when>
  25. <xsl:when test="$authors[orgname]">
  26. <xsl:value-of select="$authors/orgname"/>
  27. </xsl:when>
  28. <xsl:otherwise>
  29. <xsl:call-template name="person.name">
  30. <xsl:with-param name="node" select="$authors"/>
  31. </xsl:call-template>
  32. </xsl:otherwise>
  33. </xsl:choose>
  34. </xsl:variable>
  35. <xsl:element name="axf:document-info">
  36. <xsl:attribute name="name">author</xsl:attribute>
  37. <xsl:attribute name="value">
  38. <xsl:value-of select="normalize-space($author)"/>
  39. </xsl:attribute>
  40. </xsl:element>
  41. </xsl:if>
  42. <xsl:variable name="title">
  43. <xsl:apply-templates select="/*[1]" mode="label.markup"/>
  44. <xsl:apply-templates select="/*[1]" mode="title.markup"/>
  45. </xsl:variable>
  46. <!-- * see bug report #1465301 - mzjn -->
  47. <axf:document-info name="title">
  48. <xsl:attribute name="value">
  49. <xsl:value-of select="normalize-space($title)"/>
  50. </xsl:attribute>
  51. </axf:document-info>
  52. <xsl:if test="//keyword">
  53. <xsl:element name="axf:document-info">
  54. <xsl:attribute name="name">keywords</xsl:attribute>
  55. <xsl:attribute name="value">
  56. <xsl:for-each select="//keyword">
  57. <xsl:value-of select="normalize-space(.)"/>
  58. <xsl:if test="position() != last()">
  59. <xsl:text>, </xsl:text>
  60. </xsl:if>
  61. </xsl:for-each>
  62. </xsl:attribute>
  63. </xsl:element>
  64. </xsl:if>
  65. <xsl:if test="//subjectterm">
  66. <xsl:element name="axf:document-info">
  67. <xsl:attribute name="name">subject</xsl:attribute>
  68. <xsl:attribute name="value">
  69. <xsl:for-each select="//subjectterm">
  70. <xsl:value-of select="normalize-space(.)"/>
  71. <xsl:if test="position() != last()">
  72. <xsl:text>, </xsl:text>
  73. </xsl:if>
  74. </xsl:for-each>
  75. </xsl:attribute>
  76. </xsl:element>
  77. </xsl:if>
  78. </xsl:template>
  79. <!-- These properties are added to fo:simple-page-master -->
  80. <xsl:template name="axf-page-master-properties">
  81. <xsl:param name="page.master" select="''"/>
  82. <xsl:if test="$crop.marks != 0">
  83. <xsl:attribute name="axf:printer-marks">crop</xsl:attribute>
  84. <xsl:attribute name="axf:bleed"><xsl:value-of
  85. select="$crop.mark.bleed"/></xsl:attribute>
  86. <xsl:attribute name="axf:printer-marks-line-width"><xsl:value-of
  87. select="$crop.mark.width"/></xsl:attribute>
  88. <xsl:attribute name="axf:crop-offset"><xsl:value-of
  89. select="$crop.mark.offset"/></xsl:attribute>
  90. </xsl:if>
  91. <xsl:call-template name="user-axf-page-master-properties">
  92. <xsl:with-param name="page.master" select="$page.master"/>
  93. </xsl:call-template>
  94. </xsl:template>
  95. <xsl:template name="user-axf-page-master-properties">
  96. <xsl:param name="page.master" select="''"/>
  97. </xsl:template>
  98. </xsl:stylesheet>