Guest User

Untitled

a guest
Oct 23rd, 2013
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.35 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:fo="http://www.w3.org/1999/XSL/Format">
  4. <xsl:template match="/">
  5. <fo:root>
  6. <fo:layout-master-set >
  7. <fo:simple-page-master master-name="simple" page-height="29.7cm" page-width="21cm"
  8. margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
  9. <fo:region-body />
  10. <!--<fo:region-after region-name="first-page-footer" margin-bottom="2cm" extent="11in" display-align="after"/>-->
  11. </fo:simple-page-master>
  12. </fo:layout-master-set>
  13. <fo:page-sequence master-reference="simple">
  14. <xsl:call-template name="mainTemplate"/>
  15. </fo:page-sequence>
  16. </fo:root>
  17. </xsl:template>
  18.  
  19. <xsl:template name="mainTemplate">
  20.  
  21. <xsl:variable name="newline">
  22. <xsl:text>&#160;</xsl:text>
  23. </xsl:variable>
  24. <xsl:variable name="logoURL" >
  25. <xsl:value-of select="/export/logotype"/>
  26. </xsl:variable>
  27. <xsl:variable name="signatureURL">
  28. <xsl:value-of select="/export/signature"/>
  29. </xsl:variable>
  30.  
  31. <fo:flow flow-name="xsl-region-body">
  32. <fo:block space-before="2cm" space-after="2cm" font-size="12pt"
  33. font-family="Times New Roman">
  34.  
  35. <fo:block space-before="2cm" space-after="2cm" >
  36. <fo:table border-color="black" border-style="solid"
  37. border-width="0.5pt" >
  38. <fo:table-column column-width="3cm" border-color="black" border-style="solid"
  39. border-width="0.5pt"/>
  40. <fo:table-column column-width="3cm" border-color="black" border-style="solid"
  41. border-width="0.5pt"/>
  42. <fo:table-column column-width="3cm" border-color="black" border-style="solid"
  43. border-width="0.5pt"/>
  44. <fo:table-column column-width="8cm" border-color="black" border-style="solid"
  45. border-width="0.5pt"/>
  46. <fo:table-body>
  47. <fo:table-row>
  48. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  49. <fo:block font-weight="bold" text-align="center">Number</fo:block>
  50. </fo:table-cell>
  51. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  52. <fo:block font-weight="bold" text-align="center">Date</fo:block>
  53. </fo:table-cell>
  54. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  55. <fo:block font-weight="bold" text-align="center">Bill</fo:block>
  56. </fo:table-cell>
  57. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  58. <fo:block font-weight="bold" text-align="center">Owner</fo:block>
  59. </fo:table-cell>
  60. </fo:table-row>
  61.  
  62. <xsl:for-each select="/export/Cars/car">
  63. <xsl:variable name="param1" select="number"/>
  64. <xsl:variable name="param2" select="date"/>
  65. <xsl:variable name="param3" select="bill"/>
  66. <xsl:variable name="param4" select="owner"/>
  67. <fo:table-row>
  68. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt"
  69. padding-left="3pt">
  70. <fo:block text-align="center">
  71. <xsl:value-of select="$param1"/>
  72. </fo:block>
  73. </fo:table-cell>
  74. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt"
  75. padding-left="3pt" padding-right="3pt" display-align="center">
  76. <fo:block text-align="center">
  77. <xsl:value-of select="$param2"/>
  78. </fo:block>
  79. </fo:table-cell>
  80. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt"
  81. padding-left="3pt" padding-right="3pt" display-align="center">
  82. <fo:block text-align="center">
  83. <xsl:value-of select="$param3"/>
  84. </fo:block>
  85. </fo:table-cell >
  86. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt"
  87. padding-left="3pt" padding-right="3pt" display-align="center">
  88. <fo:block text-align="center">
  89. <xsl:value-of select="$param4"/>
  90. </fo:block>
  91. </fo:table-cell>
  92. </fo:table-row>
  93. </xsl:for-each>
  94. </fo:table-body>
  95. </fo:table>
  96. </fo:block>
  97.  
  98. <fo:block>
  99. <xsl:value-of select="$newline"/>
  100. </fo:block>
  101. <fo:block>
  102. <xsl:value-of select="$newline"/>
  103. </fo:block>
  104.  
  105. <fo:block space-after="2cm" >
  106. <fo:table border-color="black" border-style="solid"
  107. border-width="0.5pt" >
  108. <fo:table-column column-width="3cm" border-color="black" border-style="solid" border-width="0.5pt"/>
  109. <fo:table-column column-width="14cm" border-color="black" border-style="solid" border-width="0.5pt"/>
  110. <fo:table-body>
  111. <fo:table-row>
  112. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  113. <fo:block font-weight="bold" text-align="center">Graph 6</fo:block>
  114. </fo:table-cell>
  115.  
  116. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  117. <fo:block text-align="center"><xsl:value-of select="/export/graph6"/></fo:block>
  118. </fo:table-cell>
  119. </fo:table-row>
  120. <fo:table-row>
  121. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  122. <fo:block font-weight="bold" text-align="center">Graph 5</fo:block>
  123. </fo:table-cell>
  124.  
  125. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  126. <fo:block text-align="center"><xsl:value-of select="/export/graph5"/></fo:block>
  127. </fo:table-cell>
  128. </fo:table-row>
  129. <fo:table-row>
  130. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  131. <fo:block font-weight="bold" text-align="center">Graph 4</fo:block>
  132. </fo:table-cell>
  133.  
  134. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  135. <fo:block text-align="center"><xsl:value-of select="/export/graph4"/></fo:block>
  136. </fo:table-cell>
  137. </fo:table-row>
  138. <fo:table-row>
  139. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  140. <fo:block font-weight="bold" text-align="center">Graph1</fo:block>
  141. </fo:table-cell>
  142.  
  143. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  144. <fo:block text-align="center"><xsl:value-of select="/export/graph1"/></fo:block>
  145. </fo:table-cell>
  146. </fo:table-row>
  147. <fo:table-row>
  148. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  149. <fo:block font-weight="bold" text-align="center">Graph 2</fo:block>
  150. </fo:table-cell>
  151.  
  152. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  153. <fo:block text-align="center"><xsl:value-of select="/export/graph2"/></fo:block>
  154. </fo:table-cell>
  155. </fo:table-row>
  156. <fo:table-row>
  157. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  158. <fo:block font-weight="bold" text-align="center">Graph3</fo:block>
  159. </fo:table-cell>
  160.  
  161. <fo:table-cell border-color="black" border-style="solid" border-width="0.5pt">
  162. <fo:block text-align="center"><xsl:value-of select="/export/graph3"/></fo:block>
  163. </fo:table-cell>
  164. </fo:table-row>
  165. </fo:table-body>
  166. </fo:table>
  167. </fo:block>
  168.  
  169. <fo:block>
  170. <xsl:value-of select="$newline"/>
  171. </fo:block>
  172. <fo:block>
  173. <xsl:value-of select="$newline"/>
  174. </fo:block>
  175.  
  176. <fo:block text-align="justify" >
  177. <xsl:value-of select="/export/contactInfo"/>
  178. </fo:block>
  179.  
  180. <fo:block>
  181. <xsl:value-of select="$newline"/>
  182. </fo:block>
  183.  
  184. <fo:table border-width="0" margin-bottom="3cm" >
  185. <fo:table-column column-width="5.6cm" />
  186. <fo:table-column column-width="5.6cm" />
  187. <fo:table-column column-width="5.6cm" />
  188. <fo:table-body>
  189. <fo:table-row>
  190. <fo:table-cell display-align="after">
  191. <fo:block text-align="left">
  192. Occupation <xsl:value-of select="/export/occupation"/>
  193. </fo:block>
  194. </fo:table-cell>
  195. <fo:table-cell display-align="before">
  196. <fo:block text-align="center">
  197. Signature <fo:external-graphic src='url({$signatureURL})'/>
  198. </fo:block>
  199. </fo:table-cell>
  200. <fo:table-cell display-align="after">
  201. <fo:block text-align="left">
  202. Name <xsl:value-of select="/export/name"/>
  203. </fo:block>
  204. </fo:table-cell>
  205. </fo:table-row>
  206. </fo:table-body>
  207. </fo:table>
  208.  
  209. </fo:block>
  210.  
  211. </fo:flow>
  212. </xsl:template>
  213.  
  214. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment