header.xsl 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--***********************************************************
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one
  5. * or more contributor license agreements. See the NOTICE file
  6. * distributed with this work for additional information
  7. * regarding copyright ownership. The ASF licenses this file
  8. * to you under the Apache License, Version 2.0 (the
  9. * "License"); you may not use this file except in compliance
  10. * with the License. You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing,
  15. * software distributed under the License is distributed on an
  16. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17. * KIND, either express or implied. See the License for the
  18. * specific language governing permissions and limitations
  19. * under the License.
  20. *
  21. ***********************************************************-->
  22. <!--
  23. For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
  24. -->
  25. <xsl:stylesheet version="1.0"
  26. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  27. xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
  28. xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
  29. xmlns:dc="http://purl.org/dc/elements/1.1/"
  30. xmlns:dom="http://www.w3.org/2001/xml-events"
  31. xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
  32. xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
  33. xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
  34. xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
  35. xmlns:math="http://www.w3.org/1998/Math/MathML"
  36. xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
  37. xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
  38. xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
  39. xmlns:ooo="http://openoffice.org/2004/office"
  40. xmlns:oooc="http://openoffice.org/2004/calc"
  41. xmlns:ooow="http://openoffice.org/2004/writer"
  42. xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
  43. xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
  44. xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
  45. xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
  46. xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
  47. xmlns:xforms="http://www.w3.org/2002/xforms"
  48. xmlns:xlink="http://www.w3.org/1999/xlink"
  49. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  50. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  51. exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi xforms xsd xsi"
  52. xmlns="http://www.w3.org/1999/xhtml">
  53. <!-- ************** -->
  54. <!-- *** header *** -->
  55. <!-- ************** -->
  56. <xsl:template name="create-header">
  57. <xsl:param name="globalData" />
  58. <xsl:element name="head">
  59. <xsl:attribute name="profile">http://dublincore.org/documents/dcmi-terms/</xsl:attribute>
  60. <xsl:if test="$debugEnabled"><xsl:message>CSS helper variable will be created....</xsl:message></xsl:if>
  61. <xsl:call-template name='xhtml-header-properties'>
  62. <xsl:with-param name="globalData" select="$globalData" />
  63. </xsl:call-template>
  64. <xsl:if test="$debugEnabled"><xsl:message>CSS variable ready, header will be created....</xsl:message></xsl:if>
  65. <!-- constructing the css header simulating inheritance of style-families by style order -->
  66. <xsl:call-template name='create-css-styleheader'>
  67. <xsl:with-param name="globalData" select="$globalData" />
  68. </xsl:call-template>
  69. <xsl:if test="$debugEnabled"><xsl:message>CSS header creation finished!</xsl:message></xsl:if>
  70. </xsl:element>
  71. </xsl:template>
  72. <!-- Creating a CSS style header from the collected styles of the 'globalData' parameter -->
  73. <xsl:template name='create-css-styleheader'>
  74. <xsl:param name="globalData" />
  75. <xsl:element name="style">
  76. <xsl:attribute name="type">text/css</xsl:attribute>
  77. <xsl:text>
  78. </xsl:text>
  79. <xsl:call-template name='create-page-layout'>
  80. <xsl:with-param name="globalData" select="$globalData" />
  81. </xsl:call-template>
  82. <xsl:text>table { border-collapse:collapse; border-spacing:0; empty-cells:show }
  83. </xsl:text>
  84. <xsl:choose>
  85. <xsl:when test="/*/office:body/office:spreadsheet"><xsl:text>td, th { vertical-align:top; font-size:10pt;}
  86. </xsl:text></xsl:when>
  87. <xsl:otherwise><xsl:text>td, th { vertical-align:top; font-size:12pt;}
  88. </xsl:text></xsl:otherwise>
  89. </xsl:choose>
  90. <xsl:text>h1, h2, h3, h4, h5, h6 { clear:both }
  91. </xsl:text>
  92. <xsl:text>ol, ul { margin:0; padding:0;}
  93. </xsl:text>
  94. <xsl:text>li { list-style: none; margin:0; padding:0;}
  95. </xsl:text>
  96. <xsl:comment> "li span.odfLiEnd" - IE 7 issue</xsl:comment>
  97. <xsl:text>
  98. </xsl:text>
  99. <xsl:text>li span. { clear: both; line-height:0; width:0; height:0; margin:0; padding:0; }
  100. </xsl:text>
  101. <xsl:text>span.footnodeNumber { padding-right:1em; }
  102. </xsl:text>
  103. <xsl:text>span.annotation_style_by_filter { font-size:95%; font-family:Arial; background-color:#fff000; margin:0; border:0; padding:0; }
  104. </xsl:text>
  105. <xsl:text>* { margin:0;}
  106. </xsl:text>
  107. <xsl:call-template name="write-mapped-CSS-styles">
  108. <xsl:with-param name="globalData" select="$globalData" />
  109. </xsl:call-template>
  110. </xsl:element>
  111. </xsl:template>
  112. <xsl:template name="write-mapped-CSS-styles">
  113. <xsl:param name="globalData" />
  114. <xsl:param name="styleNo" select="1"/>
  115. <xsl:param name="emptyStyles"/>
  116. <xsl:choose>
  117. <xsl:when test="$globalData/all-styles/style[$styleNo]">
  118. <!-- If there is still a style to be written -->
  119. <!-- setting the context -->
  120. <xsl:for-each select="$globalData/all-styles/style[$styleNo]">
  121. <xsl:choose>
  122. <xsl:when test="final-properties != ''">
  123. <!-- NOTE: easy process, as only the style family in conjunction with the style name, makes the style unambigous -->
  124. <xsl:text>.</xsl:text><!--<xsl:value-of select="@style:family" /><xsl:text>:</xsl:text>--><xsl:value-of select="translate(@style:name, '.,;: %()[]/\+', '_____________')"/><xsl:text> { </xsl:text> <xsl:value-of select="final-properties" /><xsl:text>}
  125. </xsl:text>
  126. <xsl:call-template name="write-mapped-CSS-styles">
  127. <xsl:with-param name="globalData" select="$globalData" />
  128. <xsl:with-param name="emptyStyles" select="$emptyStyles"/>
  129. <xsl:with-param name="styleNo" select="$styleNo + 1"/>
  130. </xsl:call-template>
  131. </xsl:when>
  132. <xsl:otherwise>
  133. <xsl:call-template name="write-mapped-CSS-styles">
  134. <xsl:with-param name="globalData" select="$globalData" />
  135. <xsl:with-param name="emptyStyles" select="concat($emptyStyles, '.', @style:name, ' ')"/>
  136. <xsl:with-param name="styleNo" select="$styleNo + 1"/>
  137. </xsl:call-template>
  138. </xsl:otherwise>
  139. </xsl:choose>
  140. </xsl:for-each>
  141. </xsl:when>
  142. <xsl:otherwise>
  143. <!-- Otherwise all styles have been processed and the empty styles have to be given out -->
  144. <xsl:comment> ODF styles with no properties representable as CSS </xsl:comment><xsl:text>
  145. </xsl:text><xsl:value-of select="$emptyStyles"/><xsl:text>{ }
  146. </xsl:text>
  147. </xsl:otherwise>
  148. </xsl:choose>
  149. </xsl:template>
  150. <!-- Creating CSS page layout based on first office master style -->
  151. <xsl:template name='create-page-layout'>
  152. <xsl:param name="globalData" />
  153. <!-- approximation to find the correct master page style (with page dimensions) -->
  154. <xsl:variable name="masterPageNames">
  155. <!-- set context to styles.xml -->
  156. <xsl:for-each select="$globalData/all-doc-styles/style">
  157. <!-- Loop over every style:style containing a @style:master-page-name attribute -->
  158. <xsl:for-each select="key('masterPage','count')">
  159. <!-- set context to styles.xml -->
  160. <xsl:for-each select="/*/office:body">
  161. <!-- Check if this style is being used in the body -->
  162. <xsl:if test="key('elementUsingStyle', ../@style:name)">
  163. <!-- Check every master-page-name if it is not emtpy and return as ';' separated list -->
  164. <xsl:if test="string-length(../@style:master-page-name) &gt; 0"><xsl:value-of select="../@style:master-page-name"/>;</xsl:if>
  165. </xsl:if>
  166. </xsl:for-each>
  167. </xsl:for-each>
  168. </xsl:for-each>
  169. </xsl:variable>
  170. <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
  171. <xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
  172. <!-- Find the according style:page-layout and store the properties in a variable -->
  173. <xsl:variable name="pageProperties" select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties"/>
  174. <xsl:text>@page { </xsl:text>
  175. <xsl:call-template name="page-size">
  176. <xsl:with-param name="globalData" select="$globalData" />
  177. <xsl:with-param name="pageProperties" select="$pageProperties" />
  178. </xsl:call-template>
  179. <xsl:call-template name="page-margin">
  180. <xsl:with-param name="globalData" select="$globalData" />
  181. <xsl:with-param name="pageProperties" select="$pageProperties" />
  182. </xsl:call-template>
  183. <xsl:text> }
  184. </xsl:text>
  185. </xsl:template>
  186. <xsl:template name="page-size">
  187. <xsl:param name="globalData" />
  188. <xsl:param name="pageProperties" />
  189. <xsl:variable name="printOrientation" select="$pageProperties/@style:print-orientation" />
  190. <xsl:variable name="pageWidth" select="$pageProperties/@fo:page-width" />
  191. <xsl:variable name="pageHeight" select="$pageProperties/@fo:page-height" />
  192. <xsl:choose>
  193. <xsl:when test="$pageWidth and $pageHeight">
  194. <xsl:text>size: </xsl:text>
  195. <xsl:value-of select="$pageWidth" />
  196. <xsl:text> </xsl:text>
  197. <xsl:value-of select="$pageHeight" />
  198. <xsl:text>; </xsl:text>
  199. </xsl:when>
  200. <xsl:when test="$printOrientation">
  201. <xsl:text>size: </xsl:text>
  202. <xsl:value-of select="$printOrientation" />
  203. <xsl:text>; </xsl:text>
  204. </xsl:when>
  205. </xsl:choose>
  206. </xsl:template>
  207. <xsl:template name="page-margin">
  208. <xsl:param name="globalData" />
  209. <xsl:param name="pageProperties" />
  210. <xsl:variable name="marginTop" select="$pageProperties/@fo:margin-top" />
  211. <xsl:if test="$marginTop">
  212. <xsl:text>margin-top: </xsl:text>
  213. <xsl:value-of select="$marginTop" />
  214. <xsl:text>; </xsl:text>
  215. </xsl:if>
  216. <xsl:variable name="marginBottom" select="$pageProperties/@fo:margin-bottom" />
  217. <xsl:if test="$marginBottom">
  218. <xsl:text>margin-bottom: </xsl:text>
  219. <xsl:value-of select="$marginBottom" />
  220. <xsl:text>; </xsl:text>
  221. </xsl:if>
  222. <xsl:variable name="marginLeft" select="$pageProperties/@fo:margin-left" />
  223. <xsl:if test="$marginLeft">
  224. <xsl:text>margin-left: </xsl:text>
  225. <xsl:value-of select="$marginLeft" />
  226. <xsl:text>; </xsl:text>
  227. </xsl:if>
  228. <xsl:variable name="marginRight" select="$pageProperties/@fo:margin-right" />
  229. <xsl:if test="$marginRight">
  230. <xsl:text>margin-right: </xsl:text>
  231. <xsl:value-of select="$marginRight" />
  232. </xsl:if>
  233. </xsl:template>
  234. <!-- *************************** -->
  235. <!-- *** Common XHTML header *** -->
  236. <!-- *************************** -->
  237. <xsl:template name='xhtml-header-properties'>
  238. <xsl:param name="globalData" />
  239. <xsl:variable name="netloc">
  240. <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined">
  241. <xsl:if test="./@meta:name='ODF.base'">
  242. <xsl:value-of select="." />
  243. </xsl:if>
  244. </xsl:for-each>
  245. <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined">
  246. <xsl:if test="./@meta:name='ODF.filename'">
  247. <xsl:value-of select="." />
  248. </xsl:if>
  249. </xsl:for-each>
  250. </xsl:variable>
  251. <xsl:variable name="lang">
  252. <xsl:choose>
  253. <xsl:when test="$globalData/meta-file/*/office:meta/dc:language">
  254. <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:language" />
  255. </xsl:when>
  256. <xsl:otherwise>en-US</xsl:otherwise>
  257. </xsl:choose>
  258. </xsl:variable>
  259. <xsl:variable name="prov">
  260. <xsl:choose>
  261. <xsl:when test="$globalData/meta-file/*/office:meta/meta:printed-by">
  262. <xsl:value-of select="concat('Printed by &quot;',$globalData/meta-file/*/office:meta/meta:printed-by,'&quot;[dc:publisher] on &quot;',$globalData/meta-file/*/office:meta/meta:print-date,'&quot;[dc:date] in &quot;',$lang,'&quot;[dc:language]')" />
  263. </xsl:when>
  264. <xsl:otherwise />
  265. </xsl:choose>
  266. </xsl:variable>
  267. <xsl:variable name="keywords">
  268. <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:keyword">
  269. <xsl:value-of select="." />
  270. <xsl:if test="position() != last()">
  271. <xsl:text>, </xsl:text>
  272. </xsl:if>
  273. </xsl:for-each>
  274. </xsl:variable>
  275. <!-- explicit output content-type for low-tech browser (e.g. IE6) -->
  276. <xsl:element name="meta">
  277. <xsl:attribute name="http-equiv">Content-Type</xsl:attribute>
  278. <xsl:attribute name="content">application/xhtml+xml; charset=utf-8</xsl:attribute>
  279. </xsl:element>
  280. <!-- title of document for browser frame title -->
  281. <xsl:element name="title">
  282. <xsl:attribute name="lang" namespace="http://www.w3.org/XML/1998/namespace">
  283. <xsl:value-of select="$lang" />
  284. </xsl:attribute>
  285. <xsl:choose>
  286. <xsl:when test="$globalData/meta-file/*/office:meta/dc:title">
  287. <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:title" />
  288. </xsl:when>
  289. <!-- providing the mandatory title is a workaround for an IE bug-->
  290. <xsl:otherwise>
  291. <xsl:text>- no title specified</xsl:text>
  292. </xsl:otherwise>
  293. </xsl:choose>
  294. </xsl:element>
  295. <!-- title, in DC syntax -->
  296. <xsl:element name="meta">
  297. <xsl:attribute name="name">DCTERMS.title</xsl:attribute>
  298. <xsl:attribute name="content">
  299. <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:title" />
  300. </xsl:attribute>
  301. <xsl:attribute name="lang" namespace="http://www.w3.org/XML/1998/namespace">
  302. <xsl:value-of select="$lang" />
  303. </xsl:attribute>
  304. </xsl:element>
  305. <!-- the identifier for source (identifier) -->
  306. <xsl:call-template name="add-meta-tag">
  307. <xsl:with-param name="meta-name" select="'DCTERMS.identifier'" />
  308. <xsl:with-param name="meta-data" select="translate($netloc, ' ','')" />
  309. <xsl:with-param name="meta-enc" select="'DCTERMS.URI'" />
  310. </xsl:call-template>
  311. <!-- the language for source (language) -->
  312. <xsl:call-template name="add-meta-tag">
  313. <xsl:with-param name="meta-name" select="'DCTERMS.language'" />
  314. <xsl:with-param name="meta-data" select="$lang" />
  315. <xsl:with-param name="meta-enc" select="'DCTERMS.RFC4646'" />
  316. </xsl:call-template>
  317. <!-- a bit commercial (generator) -->
  318. <xsl:element name="meta">
  319. <xsl:attribute name="name">DCTERMS.source</xsl:attribute>
  320. <xsl:attribute name="content">http://xml.openoffice.org/odf2xhtml</xsl:attribute>
  321. </xsl:element>
  322. <!-- the author of the input source (author) -->
  323. <xsl:call-template name="add-meta-tag">
  324. <xsl:with-param name="meta-name" select="'DCTERMS.creator'" />
  325. <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/meta:initial-creator" />
  326. </xsl:call-template>
  327. <!-- creation-date of the input source (issued) -->
  328. <xsl:call-template name="add-meta-tag">
  329. <xsl:with-param name="meta-name" select="'DCTERMS.issued'" />
  330. <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/meta:creation-date" />
  331. <xsl:with-param name="meta-enc" select="'DCTERMS.W3CDTF'" />
  332. </xsl:call-template>
  333. <!-- name of last changing person of the input source (changedby) -->
  334. <xsl:call-template name="add-meta-tag">
  335. <xsl:with-param name="meta-name" select="'DCTERMS.contributor'" />
  336. <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/dc:creator" />
  337. </xsl:call-template>
  338. <!-- last changing date of the input source (changed) -->
  339. <xsl:call-template name="add-meta-tag">
  340. <xsl:with-param name="meta-name" select="'DCTERMS.modified'" />
  341. <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/dc:date" />
  342. <xsl:with-param name="meta-enc" select="'DCTERMS.W3CDTF'" />
  343. </xsl:call-template>
  344. <!-- Last print, as provenance -->
  345. <xsl:if test="$prov">
  346. <xsl:call-template name="add-meta-tag">
  347. <xsl:with-param name="meta-name" select="'DCTERMS.provenance'" />
  348. <xsl:with-param name="meta-data" select="$prov" />
  349. <xsl:with-param name="meta-lang" select="$lang" />
  350. </xsl:call-template>
  351. </xsl:if>
  352. <!-- keywords about the input source (keywords) -->
  353. <xsl:call-template name="add-meta-tag">
  354. <xsl:with-param name="meta-name" select="'DCTERMS.subject'" />
  355. <xsl:with-param name="meta-data" select="normalize-space(concat($globalData/meta-file/*/office:meta/dc:subject,', ',$keywords))" />
  356. <xsl:with-param name="meta-lang" select="$lang" />
  357. </xsl:call-template>
  358. <!-- detailed description about the input source (description) -->
  359. <xsl:call-template name="add-meta-tag">
  360. <xsl:with-param name="meta-name" select="'DCTERMS.description'" />
  361. <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/dc:description" />
  362. <xsl:with-param name="meta-lang" select="$lang" />
  363. </xsl:call-template>
  364. <!-- user defined use of DCTERM tags -->
  365. <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined[starts-with(@meta:name,'DCTERMS.')][not(.='')]">
  366. <xsl:call-template name="add-meta-tag">
  367. <xsl:with-param name="meta-name" select="@meta:name" />
  368. <xsl:with-param name="meta-data" select="." />
  369. <!-- <xsl:with-param name="meta-lang" select="$lang" /> -->
  370. </xsl:call-template>
  371. </xsl:for-each>
  372. <!-- user defined use of DC tags (legacy) -->
  373. <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined[starts-with(@meta:name,'DC.')][not(.='')]">
  374. <xsl:call-template name="add-meta-tag">
  375. <xsl:with-param name="meta-name" select="@meta:name" />
  376. <xsl:with-param name="meta-data" select="." />
  377. <!-- <xsl:with-param name="meta-lang" select="$lang" /> -->
  378. </xsl:call-template>
  379. </xsl:for-each>
  380. <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" hreflang="en" />
  381. <link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" hreflang="en" />
  382. <link rel="schema.DCTYPE" href="http://purl.org/dc/dcmitype/" hreflang="en" />
  383. <link rel="schema.DCAM" href="http://purl.org/dc/dcam/" hreflang="en" />
  384. <!-- W3C GRDDL Profile -->
  385. <!--
  386. <link rel="transformation" href="http://xml.openoffice.org/odf2xhtml/rdf-extract.xsl" />
  387. -->
  388. <!-- base URL of document for resolving relative links
  389. NOTE: CHROME has a problem, with relative references as from content table, referencing to root directory instead of document
  390. <xsl:element name="base">
  391. <xsl:attribute name="href">-->
  392. <!-- earlier 'targetURL' was used for an absoulte reference of base provided by the Office (file URL)
  393. <xsl:value-of select="$targetURL" />
  394. now '.' let relative links work, even if document has been moved -->
  395. <!--<xsl:text>.</xsl:text>
  396. </xsl:attribute>
  397. </xsl:element>-->
  398. </xsl:template>
  399. <!-- generic template for adding common meta tags -->
  400. <xsl:template name="add-meta-tag">
  401. <xsl:param name="meta-name" />
  402. <xsl:param name="meta-data" />
  403. <xsl:param name="meta-enc" />
  404. <xsl:param name="meta-lang" />
  405. <xsl:if test="$meta-data">
  406. <xsl:element name="meta">
  407. <xsl:attribute name="name">
  408. <xsl:value-of select="$meta-name" />
  409. </xsl:attribute>
  410. <xsl:attribute name="content">
  411. <xsl:value-of select="$meta-data" />
  412. </xsl:attribute>
  413. <xsl:if test="$meta-enc">
  414. <xsl:attribute name="scheme">
  415. <xsl:value-of select="$meta-enc" />
  416. </xsl:attribute>
  417. </xsl:if>
  418. <xsl:if test="$meta-lang">
  419. <xsl:attribute name="lang" namespace="http://www.w3.org/XML/1998/namespace">
  420. <xsl:value-of select="$meta-lang" />
  421. </xsl:attribute>
  422. </xsl:if>
  423. </xsl:element>
  424. </xsl:if>
  425. </xsl:template>
  426. </xsl:stylesheet>