chunk-code.xsl 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. <?xml version="1.0" encoding="US-ASCII"?>
  2. <!--This file was created automatically by html2xhtml-->
  3. <!--from the HTML stylesheets. Do not edit this file.-->
  4. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="exsl cf ng db" version="1.0">
  5. <!-- ********************************************************************
  6. $Id$
  7. ********************************************************************
  8. This file is part of the XSL DocBook Stylesheet distribution.
  9. See ../README or http://nwalsh.com/docbook/xsl/ for copyright
  10. and other information.
  11. ******************************************************************** -->
  12. <!-- ==================================================================== -->
  13. <xsl:template match="*" mode="chunk-filename">
  14. <!-- returns the filename of a chunk -->
  15. <xsl:variable name="ischunk">
  16. <xsl:call-template name="chunk"/>
  17. </xsl:variable>
  18. <xsl:variable name="fn">
  19. <xsl:apply-templates select="." mode="recursive-chunk-filename"/>
  20. </xsl:variable>
  21. <!--
  22. <xsl:message>
  23. <xsl:value-of select="$ischunk"/>
  24. <xsl:text> (</xsl:text>
  25. <xsl:value-of select="local-name(.)"/>
  26. <xsl:text>) </xsl:text>
  27. <xsl:value-of select="$fn"/>
  28. <xsl:text>, </xsl:text>
  29. <xsl:call-template name="dbhtml-dir"/>
  30. </xsl:message>
  31. -->
  32. <!-- 2003-11-25 by ndw:
  33. The following test used to read test="$ischunk != 0 and $fn != ''"
  34. I've removed the ischunk part of the test so that href.to.uri and
  35. href.from.uri will be fully qualified even if the source or target
  36. isn't a chunk. I *think* that if $fn != '' then it's appropriate
  37. to put the directory on the front, even if the element isn't a
  38. chunk. I could be wrong. -->
  39. <xsl:if test="$fn != ''">
  40. <xsl:call-template name="dbhtml-dir"/>
  41. </xsl:if>
  42. <xsl:value-of select="$fn"/>
  43. <!-- You can't add the html.ext here because dbhtml filename= may already -->
  44. <!-- have added it. It really does have to be handled in the recursive template -->
  45. </xsl:template>
  46. <xsl:template match="*" mode="recursive-chunk-filename">
  47. <xsl:param name="recursive" select="false()"/>
  48. <!-- returns the filename of a chunk -->
  49. <xsl:variable name="ischunk">
  50. <xsl:call-template name="chunk"/>
  51. </xsl:variable>
  52. <xsl:variable name="dbhtml-filename">
  53. <xsl:call-template name="dbhtml-filename"/>
  54. </xsl:variable>
  55. <xsl:variable name="filename">
  56. <xsl:choose>
  57. <xsl:when test="$dbhtml-filename != ''">
  58. <xsl:value-of select="$dbhtml-filename"/>
  59. </xsl:when>
  60. <!-- if this is the root element, use the root.filename -->
  61. <xsl:when test="not(parent::*) and $root.filename != ''">
  62. <xsl:value-of select="$root.filename"/>
  63. <xsl:value-of select="$html.ext"/>
  64. </xsl:when>
  65. <!-- Special case -->
  66. <xsl:when test="self::legalnotice and $generate.legalnotice.link != 0">
  67. <xsl:variable name="id">
  68. <xsl:call-template name="object.id"/>
  69. </xsl:variable>
  70. <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
  71. </xsl:when>
  72. <!-- if there's no dbhtml filename, and if we're to use IDs as -->
  73. <!-- filenames, then use the ID to generate the filename. -->
  74. <xsl:when test="(@id or @xml:id) and $use.id.as.filename != 0">
  75. <xsl:value-of select="(@id|@xml:id)[1]"/>
  76. <xsl:value-of select="$html.ext"/>
  77. </xsl:when>
  78. <xsl:otherwise/>
  79. </xsl:choose>
  80. </xsl:variable>
  81. <xsl:choose>
  82. <xsl:when test="$ischunk='0'">
  83. <!-- if called on something that isn't a chunk, walk up... -->
  84. <xsl:choose>
  85. <xsl:when test="count(parent::*)&gt;0">
  86. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  87. <xsl:with-param name="recursive" select="$recursive"/>
  88. </xsl:apply-templates>
  89. </xsl:when>
  90. <!-- unless there is no up, in which case return "" -->
  91. <xsl:otherwise/>
  92. </xsl:choose>
  93. </xsl:when>
  94. <xsl:when test="not($recursive) and $filename != ''">
  95. <!-- if this chunk has an explicit name, use it -->
  96. <xsl:value-of select="$filename"/>
  97. </xsl:when>
  98. <xsl:when test="self::set">
  99. <xsl:value-of select="$root.filename"/>
  100. <xsl:if test="not($recursive)">
  101. <xsl:value-of select="$html.ext"/>
  102. </xsl:if>
  103. </xsl:when>
  104. <xsl:when test="self::book">
  105. <xsl:text>bk</xsl:text>
  106. <xsl:number level="any" format="01"/>
  107. <xsl:if test="not($recursive)">
  108. <xsl:value-of select="$html.ext"/>
  109. </xsl:if>
  110. </xsl:when>
  111. <xsl:when test="self::article">
  112. <xsl:if test="/set">
  113. <!-- in a set, make sure we inherit the right book info... -->
  114. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  115. <xsl:with-param name="recursive" select="true()"/>
  116. </xsl:apply-templates>
  117. </xsl:if>
  118. <xsl:text>ar</xsl:text>
  119. <xsl:number level="any" format="01" from="book"/>
  120. <xsl:if test="not($recursive)">
  121. <xsl:value-of select="$html.ext"/>
  122. </xsl:if>
  123. </xsl:when>
  124. <xsl:when test="self::preface">
  125. <xsl:if test="/set">
  126. <!-- in a set, make sure we inherit the right book info... -->
  127. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  128. <xsl:with-param name="recursive" select="true()"/>
  129. </xsl:apply-templates>
  130. </xsl:if>
  131. <xsl:text>pr</xsl:text>
  132. <xsl:number level="any" format="01" from="book"/>
  133. <xsl:if test="not($recursive)">
  134. <xsl:value-of select="$html.ext"/>
  135. </xsl:if>
  136. </xsl:when>
  137. <xsl:when test="self::chapter">
  138. <xsl:if test="/set">
  139. <!-- in a set, make sure we inherit the right book info... -->
  140. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  141. <xsl:with-param name="recursive" select="true()"/>
  142. </xsl:apply-templates>
  143. </xsl:if>
  144. <xsl:text>ch</xsl:text>
  145. <xsl:number level="any" format="01" from="book"/>
  146. <xsl:if test="not($recursive)">
  147. <xsl:value-of select="$html.ext"/>
  148. </xsl:if>
  149. </xsl:when>
  150. <xsl:when test="self::appendix">
  151. <xsl:if test="/set">
  152. <!-- in a set, make sure we inherit the right book info... -->
  153. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  154. <xsl:with-param name="recursive" select="true()"/>
  155. </xsl:apply-templates>
  156. </xsl:if>
  157. <xsl:text>ap</xsl:text>
  158. <xsl:number level="any" format="a" from="book"/>
  159. <xsl:if test="not($recursive)">
  160. <xsl:value-of select="$html.ext"/>
  161. </xsl:if>
  162. </xsl:when>
  163. <xsl:when test="self::part">
  164. <xsl:choose>
  165. <xsl:when test="/set">
  166. <!-- in a set, make sure we inherit the right book info... -->
  167. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  168. <xsl:with-param name="recursive" select="true()"/>
  169. </xsl:apply-templates>
  170. </xsl:when>
  171. <xsl:otherwise>
  172. </xsl:otherwise>
  173. </xsl:choose>
  174. <xsl:text>pt</xsl:text>
  175. <xsl:number level="any" format="01" from="book"/>
  176. <xsl:if test="not($recursive)">
  177. <xsl:value-of select="$html.ext"/>
  178. </xsl:if>
  179. </xsl:when>
  180. <xsl:when test="self::reference">
  181. <xsl:choose>
  182. <xsl:when test="/set">
  183. <!-- in a set, make sure we inherit the right book info... -->
  184. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  185. <xsl:with-param name="recursive" select="true()"/>
  186. </xsl:apply-templates>
  187. </xsl:when>
  188. <xsl:otherwise>
  189. </xsl:otherwise>
  190. </xsl:choose>
  191. <xsl:text>rn</xsl:text>
  192. <xsl:number level="any" format="01" from="book"/>
  193. <xsl:if test="not($recursive)">
  194. <xsl:value-of select="$html.ext"/>
  195. </xsl:if>
  196. </xsl:when>
  197. <xsl:when test="self::refentry">
  198. <xsl:choose>
  199. <xsl:when test="parent::reference">
  200. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  201. <xsl:with-param name="recursive" select="true()"/>
  202. </xsl:apply-templates>
  203. </xsl:when>
  204. <xsl:otherwise>
  205. </xsl:otherwise>
  206. </xsl:choose>
  207. <xsl:text>re</xsl:text>
  208. <xsl:number level="any" format="01" from="book"/>
  209. <xsl:if test="not($recursive)">
  210. <xsl:value-of select="$html.ext"/>
  211. </xsl:if>
  212. </xsl:when>
  213. <xsl:when test="self::colophon">
  214. <xsl:choose>
  215. <xsl:when test="/set">
  216. <!-- in a set, make sure we inherit the right book info... -->
  217. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  218. <xsl:with-param name="recursive" select="true()"/>
  219. </xsl:apply-templates>
  220. </xsl:when>
  221. <xsl:otherwise>
  222. </xsl:otherwise>
  223. </xsl:choose>
  224. <xsl:text>co</xsl:text>
  225. <xsl:number level="any" format="01" from="book"/>
  226. <xsl:if test="not($recursive)">
  227. <xsl:value-of select="$html.ext"/>
  228. </xsl:if>
  229. </xsl:when>
  230. <xsl:when test="self::sect1 or self::sect2 or self::sect3 or self::sect4 or self::sect5 or self::section">
  231. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  232. <xsl:with-param name="recursive" select="true()"/>
  233. </xsl:apply-templates>
  234. <xsl:text>s</xsl:text>
  235. <xsl:number format="01"/>
  236. <xsl:if test="not($recursive)">
  237. <xsl:value-of select="$html.ext"/>
  238. </xsl:if>
  239. </xsl:when>
  240. <xsl:when test="self::bibliography">
  241. <xsl:choose>
  242. <xsl:when test="/set">
  243. <!-- in a set, make sure we inherit the right book info... -->
  244. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  245. <xsl:with-param name="recursive" select="true()"/>
  246. </xsl:apply-templates>
  247. </xsl:when>
  248. <xsl:otherwise>
  249. </xsl:otherwise>
  250. </xsl:choose>
  251. <xsl:text>bi</xsl:text>
  252. <xsl:number level="any" format="01" from="book"/>
  253. <xsl:if test="not($recursive)">
  254. <xsl:value-of select="$html.ext"/>
  255. </xsl:if>
  256. </xsl:when>
  257. <xsl:when test="self::glossary">
  258. <xsl:choose>
  259. <xsl:when test="/set">
  260. <!-- in a set, make sure we inherit the right book info... -->
  261. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  262. <xsl:with-param name="recursive" select="true()"/>
  263. </xsl:apply-templates>
  264. </xsl:when>
  265. <xsl:otherwise>
  266. </xsl:otherwise>
  267. </xsl:choose>
  268. <xsl:text>go</xsl:text>
  269. <xsl:number level="any" format="01" from="book"/>
  270. <xsl:if test="not($recursive)">
  271. <xsl:value-of select="$html.ext"/>
  272. </xsl:if>
  273. </xsl:when>
  274. <xsl:when test="self::index">
  275. <xsl:choose>
  276. <xsl:when test="/set">
  277. <!-- in a set, make sure we inherit the right book info... -->
  278. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  279. <xsl:with-param name="recursive" select="true()"/>
  280. </xsl:apply-templates>
  281. </xsl:when>
  282. <xsl:otherwise>
  283. </xsl:otherwise>
  284. </xsl:choose>
  285. <xsl:text>ix</xsl:text>
  286. <xsl:number level="any" format="01" from="book"/>
  287. <xsl:if test="not($recursive)">
  288. <xsl:value-of select="$html.ext"/>
  289. </xsl:if>
  290. </xsl:when>
  291. <xsl:when test="self::setindex">
  292. <xsl:text>si</xsl:text>
  293. <xsl:number level="any" format="01" from="set"/>
  294. <xsl:if test="not($recursive)">
  295. <xsl:value-of select="$html.ext"/>
  296. </xsl:if>
  297. </xsl:when>
  298. <xsl:otherwise>
  299. <xsl:text>chunk-filename-error-</xsl:text>
  300. <xsl:value-of select="name(.)"/>
  301. <xsl:number level="any" format="01" from="set"/>
  302. <xsl:if test="not($recursive)">
  303. <xsl:value-of select="$html.ext"/>
  304. </xsl:if>
  305. </xsl:otherwise>
  306. </xsl:choose>
  307. </xsl:template>
  308. <!-- ==================================================================== -->
  309. <xsl:template match="processing-instruction('dbhtml')">
  310. <!-- nop -->
  311. </xsl:template>
  312. <!-- ==================================================================== -->
  313. <xsl:template match="*" mode="find.chunks">
  314. <xsl:variable name="chunk">
  315. <xsl:call-template name="chunk"/>
  316. </xsl:variable>
  317. <xsl:choose>
  318. <xsl:when test="$chunk != 0">
  319. <cf:div id="{generate-id()}">
  320. <xsl:apply-templates select="." mode="class.attribute"/>
  321. <xsl:apply-templates select="*" mode="find.chunks"/>
  322. </cf:div>
  323. </xsl:when>
  324. <xsl:otherwise>
  325. <xsl:apply-templates select="*" mode="find.chunks"/>
  326. </xsl:otherwise>
  327. </xsl:choose>
  328. </xsl:template>
  329. <xsl:template match="/">
  330. <xsl:choose>
  331. <!-- include extra test for Xalan quirk -->
  332. <xsl:when test="(function-available('exsl:node-set') or contains(system-property('xsl:vendor'), 'Apache Software Foundation')) and (*/self::ng:* or */self::db:*)">
  333. <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
  334. toss the namespace and continue. Someday we'll reverse this logic
  335. and add the namespace to documents that don't have one.
  336. But not before the whole stylesheet has been converted to use
  337. namespaces. i.e., don't hold your breath -->
  338. <xsl:message>Stripping namespace from DocBook 5 document.</xsl:message>
  339. <xsl:variable name="nons">
  340. <xsl:apply-templates mode="stripNS"/>
  341. </xsl:variable>
  342. <xsl:message>Processing stripped document.</xsl:message>
  343. <xsl:apply-templates select="exsl:node-set($nons)"/>
  344. </xsl:when>
  345. <!-- Can't process unless namespace removed -->
  346. <xsl:when test="*/self::ng:* or */self::db:*">
  347. <xsl:message terminate="yes">
  348. <xsl:text>Unable to strip the namespace from DB5 document,</xsl:text>
  349. <xsl:text> cannot proceed.</xsl:text>
  350. </xsl:message>
  351. </xsl:when>
  352. <xsl:otherwise>
  353. <xsl:choose>
  354. <xsl:when test="$rootid != ''">
  355. <xsl:choose>
  356. <xsl:when test="count(key('id',$rootid)) = 0">
  357. <xsl:message terminate="yes">
  358. <xsl:text>ID '</xsl:text>
  359. <xsl:value-of select="$rootid"/>
  360. <xsl:text>' not found in document.</xsl:text>
  361. </xsl:message>
  362. </xsl:when>
  363. <xsl:otherwise>
  364. <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
  365. <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
  366. </xsl:if>
  367. <xsl:if test="$collect.xref.targets != 'only'">
  368. <xsl:apply-templates select="key('id',$rootid)" mode="process.root"/>
  369. <xsl:if test="$tex.math.in.alt != ''">
  370. <xsl:apply-templates select="key('id',$rootid)" mode="collect.tex.math"/>
  371. </xsl:if>
  372. <xsl:if test="$generate.manifest != 0">
  373. <xsl:call-template name="generate.manifest">
  374. <xsl:with-param name="node" select="key('id',$rootid)"/>
  375. </xsl:call-template>
  376. </xsl:if>
  377. </xsl:if>
  378. </xsl:otherwise>
  379. </xsl:choose>
  380. </xsl:when>
  381. <xsl:otherwise>
  382. <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
  383. <xsl:apply-templates select="/" mode="collect.targets"/>
  384. </xsl:if>
  385. <xsl:if test="$collect.xref.targets != 'only'">
  386. <xsl:apply-templates select="/" mode="process.root"/>
  387. <xsl:if test="$tex.math.in.alt != ''">
  388. <xsl:apply-templates select="/" mode="collect.tex.math"/>
  389. </xsl:if>
  390. <xsl:if test="$generate.manifest != 0">
  391. <xsl:call-template name="generate.manifest">
  392. <xsl:with-param name="node" select="/"/>
  393. </xsl:call-template>
  394. </xsl:if>
  395. </xsl:if>
  396. </xsl:otherwise>
  397. </xsl:choose>
  398. </xsl:otherwise>
  399. </xsl:choose>
  400. </xsl:template>
  401. <xsl:template match="*" mode="process.root">
  402. <xsl:apply-templates select="."/>
  403. </xsl:template>
  404. <!-- ====================================================================== -->
  405. <xsl:template match="set|book|part|preface|chapter|appendix |article |reference|refentry |book/glossary|article/glossary|part/glossary |book/bibliography|article/bibliography|part/bibliography |colophon">
  406. <xsl:choose>
  407. <xsl:when test="$onechunk != 0 and parent::*">
  408. <xsl:apply-imports/>
  409. </xsl:when>
  410. <xsl:otherwise>
  411. <xsl:call-template name="process-chunk-element"/>
  412. </xsl:otherwise>
  413. </xsl:choose>
  414. </xsl:template>
  415. <xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
  416. <xsl:variable name="ischunk">
  417. <xsl:call-template name="chunk"/>
  418. </xsl:variable>
  419. <xsl:choose>
  420. <xsl:when test="not(parent::*)">
  421. <xsl:call-template name="process-chunk-element"/>
  422. </xsl:when>
  423. <xsl:when test="$ischunk = 0">
  424. <xsl:apply-imports/>
  425. </xsl:when>
  426. <xsl:otherwise>
  427. <xsl:call-template name="process-chunk-element"/>
  428. </xsl:otherwise>
  429. </xsl:choose>
  430. </xsl:template>
  431. <xsl:template match="setindex |book/index |article/index |part/index">
  432. <!-- some implementations use completely empty index tags to indicate -->
  433. <!-- where an automatically generated index should be inserted. so -->
  434. <!-- if the index is completely empty, skip it. -->
  435. <xsl:if test="count(*)&gt;0 or $generate.index != '0'">
  436. <xsl:call-template name="process-chunk-element"/>
  437. </xsl:if>
  438. </xsl:template>
  439. <!-- Resolve xml:base attributes -->
  440. <xsl:template match="@fileref">
  441. <!-- need a check for absolute urls -->
  442. <xsl:choose>
  443. <xsl:when test="contains(., ':')">
  444. <!-- it has a uri scheme so it is an absolute uri -->
  445. <xsl:value-of select="."/>
  446. </xsl:when>
  447. <xsl:when test="$keep.relative.image.uris != 0">
  448. <!-- leave it alone -->
  449. <xsl:value-of select="."/>
  450. </xsl:when>
  451. <xsl:otherwise>
  452. <!-- its a relative uri -->
  453. <xsl:call-template name="relative-uri">
  454. <xsl:with-param name="destdir">
  455. <xsl:call-template name="dbhtml-dir">
  456. <xsl:with-param name="context" select=".."/>
  457. </xsl:call-template>
  458. </xsl:with-param>
  459. </xsl:call-template>
  460. </xsl:otherwise>
  461. </xsl:choose>
  462. </xsl:template>
  463. <!-- ==================================================================== -->
  464. <xsl:template match="set|book|part|preface|chapter|appendix |article |reference|refentry |sect1|sect2|sect3|sect4|sect5 |section |book/glossary|article/glossary|part/glossary |book/bibliography|article/bibliography|part/bibliography |colophon" mode="enumerate-files">
  465. <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
  466. <xsl:if test="$ischunk='1'">
  467. <xsl:call-template name="make-relative-filename">
  468. <xsl:with-param name="base.dir">
  469. <xsl:if test="$manifest.in.base.dir = 0">
  470. <xsl:value-of select="$base.dir"/>
  471. </xsl:if>
  472. </xsl:with-param>
  473. <xsl:with-param name="base.name">
  474. <xsl:apply-templates mode="chunk-filename" select="."/>
  475. </xsl:with-param>
  476. </xsl:call-template>
  477. <xsl:text>
  478. </xsl:text>
  479. </xsl:if>
  480. <xsl:apply-templates select="*" mode="enumerate-files"/>
  481. </xsl:template>
  482. <xsl:template match="book/index|article/index|part/index" mode="enumerate-files">
  483. <xsl:if test="$htmlhelp.output != 1">
  484. <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
  485. <xsl:if test="$ischunk='1'">
  486. <xsl:call-template name="make-relative-filename">
  487. <xsl:with-param name="base.dir">
  488. <xsl:if test="$manifest.in.base.dir = 0">
  489. <xsl:value-of select="$base.dir"/>
  490. </xsl:if>
  491. </xsl:with-param>
  492. <xsl:with-param name="base.name">
  493. <xsl:apply-templates mode="chunk-filename" select="."/>
  494. </xsl:with-param>
  495. </xsl:call-template>
  496. <xsl:text>
  497. </xsl:text>
  498. </xsl:if>
  499. <xsl:apply-templates select="*" mode="enumerate-files"/>
  500. </xsl:if>
  501. </xsl:template>
  502. <xsl:template match="legalnotice" mode="enumerate-files">
  503. <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
  504. <xsl:if test="$generate.legalnotice.link != 0">
  505. <xsl:call-template name="make-relative-filename">
  506. <xsl:with-param name="base.dir">
  507. <xsl:if test="$manifest.in.base.dir = 0">
  508. <xsl:value-of select="$base.dir"/>
  509. </xsl:if>
  510. </xsl:with-param>
  511. <xsl:with-param name="base.name">
  512. <xsl:apply-templates mode="chunk-filename" select="."/>
  513. </xsl:with-param>
  514. </xsl:call-template>
  515. <xsl:text>
  516. </xsl:text>
  517. </xsl:if>
  518. </xsl:template>
  519. <xsl:template match="mediaobject[imageobject] | inlinemediaobject[imageobject]" mode="enumerate-files">
  520. <xsl:variable name="longdesc.uri">
  521. <xsl:call-template name="longdesc.uri">
  522. <xsl:with-param name="mediaobject" select="."/>
  523. </xsl:call-template>
  524. </xsl:variable>
  525. <xsl:variable name="mediaobject" select="."/>
  526. <xsl:if test="$html.longdesc != 0 and $mediaobject/textobject[not(phrase)]">
  527. <xsl:call-template name="longdesc.uri">
  528. <xsl:with-param name="mediaobject" select="$mediaobject"/>
  529. </xsl:call-template>
  530. <xsl:text>
  531. </xsl:text>
  532. </xsl:if>
  533. </xsl:template>
  534. <xsl:template match="text()" mode="enumerate-files">
  535. </xsl:template>
  536. </xsl:stylesheet>