Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java" version="1.0" xmlns="http://www.w3.org/1999/xhtml">
  4. <xsl:output method="xml" version="1.0" indent="yes" encoding="UTF-8" />
  5.  
  6. <xsl:template match="/">
  7. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  8.  
  9. <fo:layout-master-set>
  10. <fo:simple-page-master master-name="A4" margin="1cm">
  11. <fo:region-body margin="2cm" margin-left="1cm" margin-right="1cm"/>
  12. <fo:region-before extent="3cm"/>
  13. <fo:region-after height="0.5cm" />
  14. </fo:simple-page-master>
  15. </fo:layout-master-set>
  16.  
  17. <fo:page-sequence master-reference="A4">
  18. <fo:static-content flow-name="xsl-region-before">
  19. <fo:block font-size="24pt" font-family="Calibri">Filmoteka</fo:block>
  20. </fo:static-content>
  21.  
  22. <fo:static-content flow-name="xsl-region-after">
  23. <fo:block font-size="10pt" font-family="Calibri">
  24. Wygenerowano:<xsl:call-template name="dataCzas"/>
  25. </fo:block>
  26. </fo:static-content>
  27.  
  28. <fo:flow flow-name="xsl-region-body">
  29. <fo:block font-size="12pt" font-family="Calibri" padding-after="1cm">
  30. <fo:table table-layout="fixed" width="100%" border="solid black 1px">
  31. <fo:table-column column-width="8mm"/>
  32. <fo:table-column column-width="40mm"/>
  33. <fo:table-column column-width="40mm"/>
  34. <fo:table-column column-width="13mm"/>
  35. <fo:table-column column-width="65mm"/>
  36. <fo:table-header>
  37. <fo:table-row>
  38. <fo:table-cell border="solid black 2px">
  39. <fo:block font-weight="bold" background-color="#cccccc">Lp.</fo:block>
  40. </fo:table-cell>
  41. <fo:table-cell border="solid black 2px">
  42. <fo:block font-weight="bold" background-color="#cccccc">Tytuł PL</fo:block>
  43. </fo:table-cell>
  44. <fo:table-cell border="solid black 2px">
  45. <fo:block font-weight="bold" background-color="#cccccc">Reżyseria</fo:block>
  46. </fo:table-cell>
  47. <fo:table-cell border="solid black 2px">
  48. <fo:block font-weight="bold" background-color="#cccccc">Rok</fo:block>
  49. </fo:table-cell>
  50. <fo:table-cell border="solid black 2px">
  51. <fo:block font-weight="bold" background-color="#cccccc">Obsada</fo:block>
  52. </fo:table-cell>
  53. </fo:table-row>
  54. </fo:table-header>
  55. <fo:table-body>
  56. <xsl:apply-templates />
  57. </fo:table-body>
  58. </fo:table>
  59. </fo:block>
  60. </fo:flow>
  61.  
  62. </fo:page-sequence>
  63.  
  64. </fo:root>
  65. </xsl:template>
  66.  
  67.  
  68. <xsl:template match="film">
  69. <fo:table-row>
  70. <fo:table-cell border="solid black 1px">
  71. <fo:block><xsl:number format="1"/></fo:block>
  72. </fo:table-cell>
  73. <fo:table-cell border="solid black 1px">
  74. <fo:block font-family="Calibri"><xsl:value-of select="tytul_pol"/></fo:block>
  75. </fo:table-cell>
  76. <fo:table-cell border="solid black 1px">
  77. <fo:block font-family="Calibri"><xsl:value-of select="rezyser"/></fo:block>
  78. </fo:table-cell>
  79. <fo:table-cell border="solid black 1px">
  80. <fo:block font-family="Calibri"><xsl:value-of select="rok"/></fo:block>
  81. </fo:table-cell>
  82. <fo:table-cell border="solid black 1px">
  83. <fo:block font-family="Calibri"><xsl:value-of select="obsada"/></fo:block>
  84. </fo:table-cell>
  85. </fo:table-row>
  86. </xsl:template>
  87.  
  88. <xsl:template name="dataCzas">
  89. <xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new('dd MMMM yyyy, HH:mm:ss'), java:java.util.Date.new())"/>
  90. </xsl:template>
  91.  
  92. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement