Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

projectteam2fo.xsl 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
  3. <xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>
  4. <xsl:param name="versionParam" select="1.0"/>
  5. <!-- ========================= -->
  6. <!-- root element: projectteam -->
  7. <!-- ========================= -->
  8. <xsl:template match="projectteam">
  9. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  10. <fo:layout-master-set>
  11. <fo:simple-page-master master-name="simpleA4" page-height="29.7cm" page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
  12. <fo:region-body/>
  13. </fo:simple-page-master>
  14. </fo:layout-master-set>
  15. <fo:page-sequence master-reference="simpleA4">
  16. <fo:flow flow-name="xsl-region-body">
  17. <fo:block font-size="16pt" font-weight="bold" space-after="5mm">Project: <xsl:value-of select="projectname"/>
  18. </fo:block>
  19. <fo:block font-size="12pt" space-after="5mm">Version <xsl:value-of select="$versionParam"/>
  20. </fo:block>
  21. <fo:block font-size="10pt">
  22. <fo:table table-layout="fixed">
  23. <fo:table-column column-width="4cm"/>
  24. <fo:table-column column-width="4cm"/>
  25. <fo:table-column column-width="5cm"/>
  26. <fo:table-body>
  27. <xsl:apply-templates select="member"/>
  28. </fo:table-body>
  29. </fo:table>
  30. </fo:block>
  31. </fo:flow>
  32. </fo:page-sequence>
  33. </fo:root>
  34. </xsl:template>
  35. <!-- ========================= -->
  36. <!-- child element: member -->
  37. <!-- ========================= -->
  38. <xsl:template match="member">
  39. <fo:table-row>
  40. <xsl:if test="function = 'lead'">
  41. <xsl:attribute name="font-weight">bold</xsl:attribute>
  42. </xsl:if>
  43. <fo:table-cell>
  44. <fo:block>
  45. <xsl:value-of select="name"/>
  46. </fo:block>
  47. </fo:table-cell>
  48. <fo:table-cell>
  49. <fo:block>
  50. <xsl:value-of select="function"/>
  51. </fo:block>
  52. </fo:table-cell>
  53. <fo:table-cell>
  54. <fo:block>
  55. <xsl:value-of select="email"/>
  56. </fo:block>
  57. </fo:table-cell>
  58. </fo:table-row>
  59. </xsl:template>
  60. </xsl:stylesheet>