Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/ https://fsfe.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fsfeurope.xsl 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output method="html" encoding="utf-8" indent="yes"
  4. doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"
  5. doctype-system="http://www.w3.org/TR/REC-html40/loose.dtd"/>
  6. <!-- The top level element of the input file is "buildinfo" -->
  7. <xsl:template match="buildinfo">
  8. <xsl:apply-templates select="node()"/>
  9. </xsl:template>
  10. <!-- The actual HTML tree is in "buildinfo/document" -->
  11. <xsl:template match="buildinfo/document">
  12. <xsl:element name="html">
  13. <xsl:attribute name="lang">
  14. <xsl:value-of select="/buildinfo/@language"/>
  15. </xsl:attribute>
  16. <xsl:if test="/buildinfo/@language='ar'">
  17. <xsl:attribute name="dir">rtl</xsl:attribute>
  18. </xsl:if>
  19. <xsl:apply-templates select="node()"/>
  20. </xsl:element>
  21. </xsl:template>
  22. <!-- HTML head -->
  23. <xsl:template match="head">
  24. <xsl:copy>
  25. <!-- Don't let search engine robots index untranslated pages -->
  26. <xsl:element name="meta">
  27. <xsl:attribute name="name">robots</xsl:attribute>
  28. <xsl:attribute name="content">
  29. <xsl:choose>
  30. <xsl:when test="/buildinfo/@language=/buildinfo/document/@language">index, follow</xsl:when>
  31. <xsl:otherwise>noindex</xsl:otherwise>
  32. </xsl:choose>
  33. </xsl:attribute>
  34. </xsl:element>
  35. <link rel="stylesheet" media="all" href="/style/fsfeurope.css" type="text/css" />
  36. <link rel="stylesheet" media="print" href="/style/print.css" type="text/css" />
  37. <xsl:if test="/buildinfo/@language='ar'">
  38. <link rel="stylesheet" media="all" href="/style/rtl.css" type="text/css" />
  39. </xsl:if>
  40. <link rel="shortcut icon" href="/graphics/fsfe.ico" type="image/x-icon" />
  41. <xsl:element name="link">
  42. <xsl:attribute name="rel">alternate</xsl:attribute>
  43. <xsl:attribute name="title">FSFE <xsl:value-of select="/buildinfo/textset/text[@id='menu1/news']" /></xsl:attribute>
  44. <xsl:attribute name="href">/news/news.<xsl:value-of select="/buildinfo/@language" />.rss</xsl:attribute>
  45. <xsl:attribute name="type">application/rss+xml</xsl:attribute>
  46. </xsl:element>
  47. <xsl:element name="link">
  48. <xsl:attribute name="rel">alternate</xsl:attribute>
  49. <xsl:attribute name="title">FSFE <xsl:value-of select="/buildinfo/textset/text[@id='menu1/events']" /></xsl:attribute>
  50. <xsl:attribute name="href">/events/events.<xsl:value-of select="/buildinfo/@language" />.rss</xsl:attribute>
  51. <xsl:attribute name="type">application/rss+xml</xsl:attribute>
  52. </xsl:element>
  53. <script src="/scripts/placeholder.js"></script>
  54. <xsl:apply-templates select="@*|node()"/>
  55. </xsl:copy>
  56. </xsl:template>
  57. <!-- Modify H1 -->
  58. <xsl:template match="h1">
  59. <xsl:copy>
  60. <xsl:apply-templates select="node()"/>
  61. </xsl:copy>
  62. <!-- Apply article rules -->
  63. <xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-1']/@content)">
  64. <xsl:element name="div">
  65. <xsl:attribute name="id">article-metadata</xsl:attribute>
  66. <xsl:element name="p">
  67. <xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-1']/@content)">
  68. <span class="label"><xsl:apply-templates select="/buildinfo/textset/text[@id='author']/node()" />: </span>
  69. <xsl:choose>
  70. <xsl:when test="/buildinfo/document/head/meta[@name='author-link-1']">
  71. <xsl:variable name="author-link-1" select="/buildinfo/document/head/meta[@name='author-link-1']/@content" />
  72. <a rel='author' href='{$author-link-1}'>
  73. <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-1']/@content" /> </a>
  74. </xsl:when>
  75. <xsl:otherwise>
  76. <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-1']/@content" />
  77. </xsl:otherwise>
  78. </xsl:choose>
  79. </xsl:if>
  80. <xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-2']/@content)">
  81. <xsl:choose>
  82. <xsl:when test="/buildinfo/document/head/meta[@name='author-link-2']">
  83. <xsl:variable name="author-link-2" select="/buildinfo/document/head/meta[@name='author-link-2']/@content" />
  84. , <a rel='author' href='{$author-link-2}'>
  85. <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-2']/@content" /> </a>
  86. </xsl:when>
  87. <xsl:otherwise>
  88. , <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-2']/@content" />
  89. </xsl:otherwise>
  90. </xsl:choose>
  91. </xsl:if>
  92. <xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-3']/@content)">
  93. <xsl:choose>
  94. <xsl:when test="/buildinfo/document/head/meta[@name='author-link-3']">
  95. <xsl:variable name="author-link-3" select="/buildinfo/document/head/meta[@name='author-link-3']/@content" />
  96. , <a rel='author' href='{$author-link-3}'>
  97. <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-3']/@content" /> </a>
  98. </xsl:when>
  99. <xsl:otherwise>
  100. , <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-3']/@content" />
  101. </xsl:otherwise>
  102. </xsl:choose>
  103. </xsl:if>
  104. <span class="label"> <xsl:apply-templates select="/buildinfo/textset/text[@id='published']/node()" />: </span><xsl:value-of select="/buildinfo/document/head/meta[@name='publication-date']/@content" />
  105. <xsl:if test = "string(/buildinfo/document/head/meta[@name='pdf-link']/@content)">
  106. <span class="label">PDF: </span>
  107. <xsl:variable name="pdf-link" select="/buildinfo/document/head/meta[@name='pdf-link']/@content" />
  108. <a href='{$pdf-link}'>download</a>
  109. </xsl:if>
  110. </xsl:element>
  111. </xsl:element>
  112. </xsl:if>
  113. <!-- End Apply article rules -->
  114. </xsl:template>
  115. <!-- End modifications to H1 -->
  116. <!-- HTML body -->
  117. <xsl:template match="body">
  118. <xsl:copy>
  119. <!-- First of all, a comment to make clear this is generated -->
  120. <xsl:comment>This file was generated by an XSLT script. Please do not edit.</xsl:comment>
  121. <xsl:element name="div">
  122. <xsl:attribute name="id">wrapper</xsl:attribute>
  123. <xsl:comment>Unnecessary div, for IE only</xsl:comment>
  124. <xsl:element name="p">
  125. <xsl:attribute name="class">n</xsl:attribute>
  126. <xsl:comment>Give non-graphical browsers a way to skip the menu.</xsl:comment>
  127. <xsl:element name="a">
  128. <!--<xsl:attribute name="id">top</xsl:attribute>-->
  129. <xsl:attribute name="href">#content</xsl:attribute>
  130. <xsl:text>Skip menu</xsl:text>
  131. </xsl:element>
  132. </xsl:element>
  133. <!-- Menu bar -->
  134. <xsl:element name="div">
  135. <xsl:attribute name="id">menu</xsl:attribute>
  136. <!-- Logo -->
  137. <xsl:element name="div">
  138. <xsl:attribute name="id">logo</xsl:attribute>
  139. <xsl:element name="a">
  140. <xsl:attribute name="href">/</xsl:attribute>
  141. <xsl:element name="img">
  142. <xsl:attribute name="alt">FSFE Logo</xsl:attribute>
  143. <xsl:attribute name="src">/graphics/logo.png</xsl:attribute>
  144. </xsl:element>
  145. </xsl:element>
  146. </xsl:element>
  147. <!-- Menu -->
  148. <xsl:for-each select="/buildinfo/menuset/menu[not(@parent)]">
  149. <xsl:sort select="@id" />
  150. <xsl:variable name="menu"><xsl:value-of select="@id" /></xsl:variable>
  151. <xsl:element name="ul">
  152. <xsl:for-each select="/buildinfo/menuset/menu[@parent=$menu]">
  153. <!--<xsl:sort select="@id"/>-->
  154. <xsl:sort select="@priority" />
  155. <xsl:variable name="id"><xsl:value-of select="@id" /></xsl:variable>
  156. <xsl:element name="li">
  157. <xsl:choose>
  158. <xsl:when test="not(string(.))">
  159. <xsl:value-of select="/buildinfo/textset/text[@id=$id]|
  160. /buildinfo/textsetbackup/text[@id=$id
  161. and not(@id=/buildinfo/textset/text/@id)]"/>
  162. </xsl:when>
  163. <xsl:when test=". = concat(/buildinfo/@filename ,'.html')">
  164. <xsl:value-of select="/buildinfo/textset/text[@id=$id]|
  165. /buildinfo/textsetbackup/text[@id=$id
  166. and not(@id=/buildinfo/textset/text/@id)]"/>
  167. </xsl:when>
  168. <xsl:otherwise>
  169. <xsl:element name="a">
  170. <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  171. <xsl:value-of select="/buildinfo/textset/text[@id=$id]|
  172. /buildinfo/textsetbackup/text[@id=$id
  173. and not(@id=/buildinfo/textset/text/@id)]"/>
  174. </xsl:element>
  175. </xsl:otherwise>
  176. </xsl:choose>
  177. <!-- Submenu -->
  178. <xsl:if test="/buildinfo/menuset/menu[@parent=$id]">
  179. <xsl:element name="ul">
  180. <xsl:for-each select="/buildinfo/menuset/menu[@parent=$id]">
  181. <!--<xsl:sort select="@id" />-->
  182. <xsl:sort select="@priority" />
  183. <xsl:variable name="mid"><xsl:value-of select="@id" /></xsl:variable>
  184. <xsl:element name="li">
  185. <xsl:attribute name="class">submenu</xsl:attribute>
  186. <xsl:choose>
  187. <xsl:when test=". = concat(/buildinfo/@filename ,'.html')">
  188. <xsl:value-of select="/buildinfo/textset/text[@id=$mid]|
  189. /buildinfo/textsetbackup/text[@id=$mid
  190. and not(@id=/buildinfo/textset/text/@id)]"/>
  191. </xsl:when>
  192. <xsl:otherwise>
  193. <xsl:element name="a">
  194. <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
  195. <xsl:value-of select="/buildinfo/textset/text[@id=$mid]|
  196. /buildinfo/textsetbackup/text[@id=$mid
  197. and not(@id=/buildinfo/textset/text/@id)]"/>
  198. </xsl:element>
  199. </xsl:otherwise>
  200. </xsl:choose>
  201. </xsl:element>
  202. </xsl:for-each>
  203. </xsl:element> <!-- /submenu ul -->
  204. </xsl:if>
  205. </xsl:element> <!-- /li -->
  206. </xsl:for-each>
  207. </xsl:element> <!-- /ul -->
  208. </xsl:for-each>
  209. <xsl:element name="div">
  210. <xsl:attribute name="id">search</xsl:attribute>
  211. <xsl:element name="h2">
  212. <xsl:attribute name="class">n</xsl:attribute>
  213. <xsl:value-of select="/buildinfo/textset/text[@id='search']" />
  214. </xsl:element>
  215. <xsl:element name="form">
  216. <xsl:attribute name="method">get</xsl:attribute>
  217. <xsl:attribute name="action">http://search.fsfe.org/yacysearch.html</xsl:attribute>
  218. <xsl:element name="input">
  219. <xsl:attribute name="type">hidden</xsl:attribute>
  220. <xsl:attribute name="name">verify</xsl:attribute>
  221. <xsl:attribute name="value">true</xsl:attribute>
  222. </xsl:element>
  223. <xsl:element name="input">
  224. <xsl:attribute name="type">hidden</xsl:attribute>
  225. <xsl:attribute name="name">maximumRecords</xsl:attribute>
  226. <xsl:attribute name="value">10</xsl:attribute>
  227. </xsl:element>
  228. <xsl:element name="input">
  229. <xsl:attribute name="type">hidden</xsl:attribute>
  230. <xsl:attribute name="name">meanCount</xsl:attribute>
  231. <xsl:attribute name="value">5</xsl:attribute>
  232. </xsl:element>
  233. <xsl:element name="input">
  234. <xsl:attribute name="type">hidden</xsl:attribute>
  235. <xsl:attribute name="name">resource</xsl:attribute>
  236. <xsl:attribute name="value">local</xsl:attribute>
  237. </xsl:element>
  238. <xsl:element name="input">
  239. <xsl:attribute name="type">hidden</xsl:attribute>
  240. <xsl:attribute name="name">prefermaskfilter</xsl:attribute>
  241. <xsl:attribute name="value">.*.<xsl:value-of select="/buildinfo/@language"/>.html</xsl:attribute>
  242. </xsl:element>
  243. <xsl:element name="input">
  244. <xsl:attribute name="type">hidden</xsl:attribute>
  245. <xsl:attribute name="name">prefermaskfilter</xsl:attribute>
  246. <xsl:attribute name="value">.*</xsl:attribute>
  247. </xsl:element>
  248. <xsl:element name="input">
  249. <xsl:attribute name="type">hidden</xsl:attribute>
  250. <xsl:attribute name="name">display</xsl:attribute>
  251. <xsl:attribute name="value">2</xsl:attribute>
  252. </xsl:element>
  253. <xsl:element name="input">
  254. <xsl:attribute name="type">hidden</xsl:attribute>
  255. <xsl:attribute name="name">nav</xsl:attribute>
  256. <xsl:attribute name="value">hosts</xsl:attribute>
  257. </xsl:element>
  258. <xsl:element name="p">
  259. <xsl:element name="input">
  260. <xsl:attribute name="type">text</xsl:attribute>
  261. <xsl:attribute name="name">query</xsl:attribute>
  262. <xsl:attribute name="placeholder">
  263. <xsl:value-of select="/buildinfo/textset/text[@id='search']" />
  264. </xsl:attribute>
  265. </xsl:element>
  266. <xsl:element name="input">
  267. <xsl:attribute name="type">image</xsl:attribute>
  268. <xsl:attribute name="src">/graphics/icons/search-button.png</xsl:attribute>
  269. </xsl:element>
  270. </xsl:element>
  271. </xsl:element>
  272. </xsl:element>
  273. <!-- Join the Fellowship -->
  274. <xsl:element name="div">
  275. <xsl:attribute name="id">fellowship</xsl:attribute>
  276. <xsl:element name="a">
  277. <xsl:attribute name="href">http://fellowship.fsfe.org/about</xsl:attribute>
  278. <xsl:element name="img">
  279. <xsl:attribute name="alt">Join the Fellowship!</xsl:attribute>
  280. <xsl:attribute name="src">/graphics/join-fellowship.png</xsl:attribute>
  281. </xsl:element>
  282. </xsl:element>
  283. </xsl:element>
  284. <!-- PDF Readers Campaign -->
  285. <xsl:element name="div">
  286. <xsl:attribute name="id">pdfr</xsl:attribute>
  287. <xsl:element name="a">
  288. <xsl:attribute name="href">http://www.fsfe.org/campaigns/pdfreaders</xsl:attribute>
  289. <xsl:element name="img">
  290. <xsl:attribute name="alt">PDF Readers Campaign</xsl:attribute>
  291. <xsl:attribute name="src">/graphics/pdf-readers-lang-neutral.png</xsl:attribute>
  292. </xsl:element>
  293. </xsl:element>
  294. </xsl:element>
  295. <!--
  296. <div id="newsletter">
  297. <p>
  298. Subscribe to <a href="/news/">our newsletter</a>!
  299. </p>
  300. <form action="http://mail.fsfeurope.org/mailman/subscribe/press-release" method="post">
  301. <p>
  302. <input type="text" name="email" placeholder="you@example.com" />
  303. <input type="submit" value="Sign up" />
  304. </p>
  305. </form>
  306. </div>
  307. -->
  308. </xsl:element>
  309. <!-- End Menu bar -->
  310. <!-- Language bar -->
  311. <xsl:element name="div">
  312. <xsl:attribute name="id">language</xsl:attribute>
  313. <!-- Translation list -->
  314. <xsl:element name="ul">
  315. <xsl:for-each select="/buildinfo/trlist/tr">
  316. <xsl:sort select="@id"/>
  317. <xsl:element name="li">
  318. <xsl:choose>
  319. <xsl:when test="@id=/buildinfo/@language">
  320. <xsl:value-of select="." disable-output-escaping="yes"/>
  321. </xsl:when>
  322. <xsl:otherwise>
  323. <xsl:element name="a">
  324. <xsl:attribute name="href"><xsl:value-of select="/buildinfo/@filename"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
  325. <xsl:value-of select="." disable-output-escaping="yes"/>
  326. </xsl:element>
  327. </xsl:otherwise>
  328. </xsl:choose>
  329. </xsl:element>
  330. </xsl:for-each>
  331. </xsl:element>
  332. <!-- Outdated note -->
  333. <xsl:if test="/buildinfo/@outdated='yes'">
  334. <xsl:element name="p">
  335. <xsl:apply-templates select="/buildinfo/textset/text[@id='outdated']/node()" />
  336. </xsl:element>
  337. </xsl:if>
  338. <!-- Missing translation note -->
  339. <xsl:if test="/buildinfo/@language!=/buildinfo/document/@language">
  340. <xsl:element name="p">
  341. <xsl:apply-templates select="/buildinfo/textset/text[@id='notranslation']/node()" />
  342. </xsl:element>
  343. </xsl:if>
  344. </xsl:element>
  345. <!-- End Language bar -->
  346. <!-- Start info box -->
  347. <xsl:element name="div">
  348. <xsl:attribute name="id">infobox</xsl:attribute>
  349. <xsl:if test = "/buildinfo/document/head/meta[@name='under-construction' and @content='true']">
  350. <xsl:element name="p">
  351. <xsl:apply-templates select="/buildinfo/textset/text[@id='under-construction']/node()" />
  352. </xsl:element>
  353. </xsl:if>
  354. </xsl:element>
  355. <!-- End info box -->
  356. <!-- Fundraising box
  357. <xsl:if test="/buildinfo/fundraising">
  358. <xsl:element name="div">
  359. <xsl:attribute name="id">fundraising</xsl:attribute>
  360. <xsl:element name="div">
  361. <xsl:attribute name="class">box</xsl:attribute>
  362. <xsl:if test="/buildinfo/fundraising/call1">
  363. <xsl:element name="p">
  364. <xsl:attribute name="class">call1</xsl:attribute>
  365. <xsl:apply-templates select="/buildinfo/fundraising/call1/node()"/>
  366. </xsl:element>
  367. </xsl:if>
  368. <xsl:if test="/buildinfo/fundraising/call2">
  369. <xsl:element name="p">
  370. <xsl:attribute name="class">call2</xsl:attribute>
  371. <xsl:apply-templates select="/buildinfo/fundraising/call2/node()"/>
  372. </xsl:element>
  373. </xsl:if>
  374. <xsl:if test="/buildinfo/fundraising/current">
  375. <xsl:element name="div">
  376. <xsl:attribute name="class">percentbox</xsl:attribute>
  377. <xsl:element name="div">
  378. <xsl:attribute name="class">percentbar</xsl:attribute>
  379. <xsl:attribute name="style">width: 45.9%</xsl:attribute>
  380. </xsl:element>
  381. </xsl:element>
  382. <xsl:element name="p">
  383. <xsl:attribute name="class">current</xsl:attribute>
  384. <xsl:apply-templates select="/buildinfo/fundraising/current/node()"/>
  385. <xsl:text>€ 45 860</xsl:text>
  386. </xsl:element>
  387. <xsl:element name="p">
  388. <xsl:attribute name="class">target</xsl:attribute>
  389. <xsl:text>€ 100 000</xsl:text>
  390. </xsl:element>
  391. </xsl:if>
  392. </xsl:element>
  393. </xsl:element>
  394. </xsl:if>
  395. End Fundraising box -->
  396. <!-- Content -->
  397. <xsl:element name="div">
  398. <xsl:attribute name="id">content</xsl:attribute>
  399. <!-- Here goes the actual content of the <body> node of the input file -->
  400. <xsl:apply-templates select="node()"/>
  401. <!-- Link to top -->
  402. <xsl:element name="p">
  403. <xsl:attribute name="class">n</xsl:attribute>
  404. <xsl:element name="a">
  405. <xsl:attribute name="href">#top</xsl:attribute>
  406. <xsl:text>To top</xsl:text>
  407. </xsl:element>
  408. </xsl:element>
  409. </xsl:element>
  410. <!-- End Content -->
  411. <!-- Footer -->
  412. <div id="footer">
  413. <div id="notice">
  414. <p>
  415. Copyright © 2001-2010 <a href="/">Free Software
  416. Foundation Europe</a>.<br />
  417. <xsl:apply-templates select="/buildinfo/textset/text[@id='permission']/node()" /><br />
  418. <!-- "Last changed" magic -->
  419. <xsl:variable name="timestamp">
  420. <xsl:value-of select="/buildinfo/document/timestamp"/>
  421. </xsl:variable>
  422. <!-- FIXME: over time, all pages should have the timestamp -->
  423. <!-- tags, so this conditional could be removed -->
  424. <xsl:if test="string-length($timestamp) &gt; 0">
  425. <xsl:variable name="Date">
  426. <xsl:value-of select="substring-before(substring-after($timestamp, 'Date: '), ' $')"/>
  427. </xsl:variable>
  428. <xsl:variable name="Author">
  429. <xsl:value-of select="substring-before(substring-after($timestamp, 'Author: '), ' $')"/>
  430. </xsl:variable>
  431. <xsl:apply-templates select="/buildinfo/textset/text[@id='lastchanged']/node()"/>
  432. <xsl:value-of select="translate ($Date, '/', '-')"/>
  433. (<xsl:value-of select="$Author"/>)
  434. </xsl:if>
  435. </p>
  436. <ul>
  437. <li>
  438. <!-- Link to the XHTML source -->
  439. <xsl:element name="a">
  440. <xsl:attribute name="href">
  441. <xsl:text>/source</xsl:text>
  442. <xsl:value-of select="/buildinfo/@filename"/>
  443. <xsl:text>.</xsl:text>
  444. <xsl:value-of select="/buildinfo/document/@language"/>
  445. <xsl:text>.xhtml</xsl:text>
  446. </xsl:attribute>
  447. <xsl:text>Source code</xsl:text>
  448. </xsl:element>
  449. </li>
  450. <li>
  451. <a href="/contribute/translators/">Translate this
  452. page?</a>
  453. </li>
  454. </ul>
  455. <p>
  456. <!-- Insert the appropriate translation notice -->
  457. <xsl:if test="/buildinfo/document/@language!=/buildinfo/@original">
  458. <xsl:choose>
  459. <xsl:when test="/buildinfo/document/translator">
  460. <xsl:value-of select="/buildinfo/textset/text[@id='translator1a']"/>
  461. <xsl:value-of select="/buildinfo/document/translator"/>
  462. <xsl:value-of select="/buildinfo/textset/text[@id='translator1b']"/>
  463. </xsl:when>
  464. <xsl:otherwise>
  465. <xsl:value-of select="/buildinfo/textset/text[@id='translator2']"/>
  466. </xsl:otherwise>
  467. </xsl:choose>
  468. <xsl:value-of select="/buildinfo/textset/text[@id='translator3a']"/>
  469. <xsl:element name="a">
  470. <xsl:attribute name="href">
  471. <xsl:value-of select="/buildinfo/@filename"/>
  472. <xsl:text>.en.html</xsl:text>
  473. </xsl:attribute>
  474. <xsl:value-of select="/buildinfo/textset/text[@id='translator3b']"/>
  475. </xsl:element>
  476. <xsl:value-of select="/buildinfo/textset/text[@id='translator3c']"/>
  477. </xsl:if>
  478. </p>
  479. </div> <!-- /#notice -->
  480. <!--
  481. <div id="sister_organizations">
  482. <h2>Sister organizations</h2>
  483. <ul>
  484. <li><a href="http://fsf.org/">North America</a></li>
  485. <li><a href="http://fsf.org.in/">India</a></li>
  486. <li><a href="http://fsfla.org/">Latin America</a></li>
  487. </ul>
  488. </div>
  489. -->
  490. <!-- FSF* netwok note -->
  491. <p id="fsfnetwork">
  492. <xsl:apply-templates select="/buildinfo/textset/text[@id='fsfnetwork']/node()"/>
  493. </p>
  494. </div> <!-- /#footer -->
  495. </xsl:element>
  496. </xsl:copy>
  497. </xsl:template>
  498. <!-- Insert local menu -->
  499. <xsl:template match="localmenu">
  500. <xsl:variable name="set">
  501. <xsl:choose>
  502. <xsl:when test="@set">
  503. <xsl:value-of select="@set"/>
  504. </xsl:when>
  505. <xsl:otherwise>
  506. <xsl:text>0</xsl:text>
  507. </xsl:otherwise>
  508. </xsl:choose>
  509. </xsl:variable>
  510. <xsl:variable name="dir">
  511. <xsl:value-of select="/buildinfo/@dirname"/>
  512. </xsl:variable>
  513. <xsl:variable name="language">
  514. <xsl:value-of select="/buildinfo/@language"/>
  515. </xsl:variable>
  516. <xsl:element name="div">
  517. <xsl:attribute name="class">localmenu</xsl:attribute>
  518. <xsl:element name="p">
  519. <xsl:text>[ </xsl:text>
  520. <xsl:for-each select="/buildinfo/localmenuset/localmenuitems/menu[@dir=$dir and @set=$set]">
  521. <xsl:sort select="@id"/>
  522. <xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
  523. <xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
  524. <xsl:variable name="localmenutext">
  525. <xsl:choose>
  526. <xsl:when
  527. test="/buildinfo/localmenuset/translate/lang_part[@dir=$dir and @id=$id and @language=$language]">
  528. <xsl:value-of
  529. select="/buildinfo/localmenuset/translate/lang_part[@dir=$dir and @id=$id and @language=$language]"/>
  530. </xsl:when>
  531. <xsl:otherwise>
  532. <xsl:value-of
  533. select="/buildinfo/localmenuset/translate/lang_part[@dir=$dir and @id=$id and @language='en']"/>
  534. </xsl:otherwise>
  535. </xsl:choose>
  536. </xsl:variable>
  537. <xsl:element name="span">
  538. <xsl:attribute name="class">local_menu_item</xsl:attribute>
  539. <xsl:choose>
  540. <xsl:when test="not(substring-before(concat(/buildinfo/@filename ,'.html'), string(.)))">
  541. <xsl:element name="a">
  542. <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
  543. <xsl:value-of select="$localmenutext"/>
  544. </xsl:element>
  545. </xsl:when>
  546. <xsl:otherwise>
  547. <xsl:value-of select="$localmenutext"/>
  548. </xsl:otherwise>
  549. </xsl:choose>
  550. </xsl:element>
  551. <xsl:if test="position()!=last()">
  552. <xsl:choose>
  553. <xsl:when test="$style='number'">
  554. <xsl:text> | </xsl:text>
  555. </xsl:when>
  556. <xsl:otherwise>
  557. <xsl:text> ] [ </xsl:text>
  558. </xsl:otherwise>
  559. </xsl:choose>
  560. </xsl:if>
  561. </xsl:for-each>
  562. <xsl:text> ]</xsl:text>
  563. </xsl:element>
  564. </xsl:element>
  565. </xsl:template>
  566. <!-- Ignore "latin" tags, used only for pritable material -->
  567. <xsl:template match="latin">
  568. <xsl:apply-templates select="@*|node()"/>
  569. </xsl:template>
  570. <!-- Do not copy non-HTML elements to output -->
  571. <xsl:template match="timestamp|
  572. translator|
  573. buildinfo/set|
  574. buildinfo/textset|
  575. buildinfo/textsetbackup|
  576. buildinfo/menuset|
  577. buildinfo/trlist|
  578. buildinfo/fundraising|
  579. buildinfo/localmenuset"/>
  580. <!-- For all other nodes, copy verbatim -->
  581. <xsl:template match="@*|node()" priority="-1">
  582. <xsl:copy>
  583. <xsl:apply-templates select="@*|node()"/>
  584. </xsl:copy>
  585. </xsl:template>
  586. </xsl:stylesheet>