axf.xsl 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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$
  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:otherwise>
  26. <xsl:call-template name="person.name">
  27. <xsl:with-param name="node" select="$authors"/>
  28. </xsl:call-template>
  29. </xsl:otherwise>
  30. </xsl:choose>
  31. </xsl:variable>
  32. <xsl:element name="axf:document-info">
  33. <xsl:attribute name="name">author</xsl:attribute>
  34. <xsl:attribute name="value">
  35. <xsl:value-of select="normalize-space($author)"/>
  36. </xsl:attribute>
  37. </xsl:element>
  38. </xsl:if>
  39. <xsl:variable name="title">
  40. <xsl:apply-templates select="/*[1]" mode="label.markup"/>
  41. <xsl:apply-templates select="/*[1]" mode="title.markup"/>
  42. </xsl:variable>
  43. <!-- * see bug report #1465301 - mzjn -->
  44. <axf:document-info name="title">
  45. <xsl:attribute name="value">
  46. <xsl:value-of select="normalize-space($title)"/>
  47. </xsl:attribute>
  48. </axf:document-info>
  49. <xsl:if test="//keyword">
  50. <xsl:element name="axf:document-info">
  51. <xsl:attribute name="name">keywords</xsl:attribute>
  52. <xsl:attribute name="value">
  53. <xsl:for-each select="//keyword">
  54. <xsl:value-of select="normalize-space(.)"/>
  55. <xsl:if test="position() != last()">
  56. <xsl:text>, </xsl:text>
  57. </xsl:if>
  58. </xsl:for-each>
  59. </xsl:attribute>
  60. </xsl:element>
  61. </xsl:if>
  62. <xsl:if test="//subjectterm">
  63. <xsl:element name="axf:document-info">
  64. <xsl:attribute name="name">subject</xsl:attribute>
  65. <xsl:attribute name="value">
  66. <xsl:for-each select="//subjectterm">
  67. <xsl:value-of select="normalize-space(.)"/>
  68. <xsl:if test="position() != last()">
  69. <xsl:text>, </xsl:text>
  70. </xsl:if>
  71. </xsl:for-each>
  72. </xsl:attribute>
  73. </xsl:element>
  74. </xsl:if>
  75. </xsl:template>
  76. <!-- These properties are added to fo:simple-page-master -->
  77. <xsl:template name="axf-page-master-properties">
  78. <xsl:param name="page.master" select="''"/>
  79. <xsl:if test="$crop.marks != 0">
  80. <xsl:attribute name="axf:printer-marks">crop</xsl:attribute>
  81. <xsl:attribute name="axf:bleed"><xsl:value-of
  82. select="$crop.mark.bleed"/></xsl:attribute>
  83. <xsl:attribute name="axf:printer-marks-line-width"><xsl:value-of
  84. select="$crop.mark.width"/></xsl:attribute>
  85. <xsl:attribute name="axf:crop-offset"><xsl:value-of
  86. select="$crop.mark.offset"/></xsl:attribute>
  87. </xsl:if>
  88. <xsl:call-template name="user-axf-page-master-properties">
  89. <xsl:with-param name="page.master" select="$page.master"/>
  90. </xsl:call-template>
  91. </xsl:template>
  92. <xsl:template name="user-axf-page-master-properties">
  93. <xsl:param name="page.master" select="''"/>
  94. </xsl:template>
  95. </xsl:stylesheet>