chunk-code.xsl 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. <?xml version="1.0" encoding="ASCII"?>
  2. <!--This file was created automatically by html2xhtml-->
  3. <!--from the HTML stylesheets.-->
  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. <!-- * Get a title for current doc so that we let the user -->
  331. <!-- * know what document we are processing at this point. -->
  332. <xsl:variable name="doc.title">
  333. <xsl:call-template name="get.doc.title"/>
  334. </xsl:variable>
  335. <xsl:choose>
  336. <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
  337. toss the namespace and continue. Use the docbook5 namespaced
  338. stylesheets for DocBook5 if you don't want to use this feature.-->
  339. <!-- include extra test for Xalan quirk -->
  340. <xsl:when test="(function-available('exsl:node-set') or contains(system-property('xsl:vendor'), 'Apache Software Foundation')) and (*/self::ng:* or */self::db:*)">
  341. <xsl:call-template name="log.message">
  342. <xsl:with-param name="level">Note</xsl:with-param>
  343. <xsl:with-param name="source" select="$doc.title"/>
  344. <xsl:with-param name="context-desc">
  345. <xsl:text>namesp. cut</xsl:text>
  346. </xsl:with-param>
  347. <xsl:with-param name="message">
  348. <xsl:text>stripped namespace before processing</xsl:text>
  349. </xsl:with-param>
  350. </xsl:call-template>
  351. <xsl:variable name="nons">
  352. <xsl:apply-templates mode="stripNS"/>
  353. </xsl:variable>
  354. <xsl:call-template name="log.message">
  355. <xsl:with-param name="level">Note</xsl:with-param>
  356. <xsl:with-param name="source" select="$doc.title"/>
  357. <xsl:with-param name="context-desc">
  358. <xsl:text>namesp. cut</xsl:text>
  359. </xsl:with-param>
  360. <xsl:with-param name="message">
  361. <xsl:text>processing stripped document</xsl:text>
  362. </xsl:with-param>
  363. </xsl:call-template>
  364. <xsl:apply-templates select="exsl:node-set($nons)"/>
  365. </xsl:when>
  366. <!-- Can't process unless namespace removed -->
  367. <xsl:when test="*/self::ng:* or */self::db:*">
  368. <xsl:message terminate="yes">
  369. <xsl:text>Unable to strip the namespace from DB5 document,</xsl:text>
  370. <xsl:text> cannot proceed.</xsl:text>
  371. </xsl:message>
  372. </xsl:when>
  373. <xsl:otherwise>
  374. <xsl:choose>
  375. <xsl:when test="$rootid != ''">
  376. <xsl:choose>
  377. <xsl:when test="count(key('id',$rootid)) = 0">
  378. <xsl:message terminate="yes">
  379. <xsl:text>ID '</xsl:text>
  380. <xsl:value-of select="$rootid"/>
  381. <xsl:text>' not found in document.</xsl:text>
  382. </xsl:message>
  383. </xsl:when>
  384. <xsl:otherwise>
  385. <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
  386. <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
  387. </xsl:if>
  388. <xsl:if test="$collect.xref.targets != 'only'">
  389. <xsl:apply-templates select="key('id',$rootid)" mode="process.root"/>
  390. <xsl:if test="$tex.math.in.alt != ''">
  391. <xsl:apply-templates select="key('id',$rootid)" mode="collect.tex.math"/>
  392. </xsl:if>
  393. <xsl:if test="$generate.manifest != 0">
  394. <xsl:call-template name="generate.manifest">
  395. <xsl:with-param name="node" select="key('id',$rootid)"/>
  396. </xsl:call-template>
  397. </xsl:if>
  398. </xsl:if>
  399. </xsl:otherwise>
  400. </xsl:choose>
  401. </xsl:when>
  402. <xsl:otherwise>
  403. <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
  404. <xsl:apply-templates select="/" mode="collect.targets"/>
  405. </xsl:if>
  406. <xsl:if test="$collect.xref.targets != 'only'">
  407. <xsl:apply-templates select="/" mode="process.root"/>
  408. <xsl:if test="$tex.math.in.alt != ''">
  409. <xsl:apply-templates select="/" mode="collect.tex.math"/>
  410. </xsl:if>
  411. <xsl:if test="$generate.manifest != 0">
  412. <xsl:call-template name="generate.manifest">
  413. <xsl:with-param name="node" select="/"/>
  414. </xsl:call-template>
  415. </xsl:if>
  416. </xsl:if>
  417. </xsl:otherwise>
  418. </xsl:choose>
  419. </xsl:otherwise>
  420. </xsl:choose>
  421. </xsl:template>
  422. <xsl:template match="*" mode="process.root">
  423. <xsl:apply-templates select="."/>
  424. </xsl:template>
  425. <!-- ====================================================================== -->
  426. <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">
  427. <xsl:choose>
  428. <xsl:when test="$onechunk != 0 and parent::*">
  429. <xsl:apply-imports/>
  430. </xsl:when>
  431. <xsl:otherwise>
  432. <xsl:call-template name="process-chunk-element"/>
  433. </xsl:otherwise>
  434. </xsl:choose>
  435. </xsl:template>
  436. <xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
  437. <xsl:variable name="ischunk">
  438. <xsl:call-template name="chunk"/>
  439. </xsl:variable>
  440. <xsl:choose>
  441. <xsl:when test="not(parent::*)">
  442. <xsl:call-template name="process-chunk-element"/>
  443. </xsl:when>
  444. <xsl:when test="$ischunk = 0">
  445. <xsl:apply-imports/>
  446. </xsl:when>
  447. <xsl:otherwise>
  448. <xsl:call-template name="process-chunk-element"/>
  449. </xsl:otherwise>
  450. </xsl:choose>
  451. </xsl:template>
  452. <xsl:template match="setindex |book/index |article/index |part/index">
  453. <!-- some implementations use completely empty index tags to indicate -->
  454. <!-- where an automatically generated index should be inserted. so -->
  455. <!-- if the index is completely empty, skip it. -->
  456. <xsl:if test="count(*)&gt;0 or $generate.index != '0'">
  457. <xsl:call-template name="process-chunk-element"/>
  458. </xsl:if>
  459. </xsl:template>
  460. <!-- Resolve xml:base attributes -->
  461. <xsl:template match="@fileref">
  462. <!-- need a check for absolute urls -->
  463. <xsl:choose>
  464. <xsl:when test="contains(., ':')">
  465. <!-- it has a uri scheme so it is an absolute uri -->
  466. <xsl:value-of select="."/>
  467. </xsl:when>
  468. <xsl:when test="$keep.relative.image.uris != 0">
  469. <!-- leave it alone -->
  470. <xsl:value-of select="."/>
  471. </xsl:when>
  472. <xsl:otherwise>
  473. <!-- its a relative uri -->
  474. <xsl:call-template name="relative-uri">
  475. <xsl:with-param name="destdir">
  476. <xsl:call-template name="dbhtml-dir">
  477. <xsl:with-param name="context" select=".."/>
  478. </xsl:call-template>
  479. </xsl:with-param>
  480. </xsl:call-template>
  481. </xsl:otherwise>
  482. </xsl:choose>
  483. </xsl:template>
  484. <!-- ==================================================================== -->
  485. <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">
  486. <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
  487. <xsl:if test="$ischunk='1'">
  488. <xsl:call-template name="make-relative-filename">
  489. <xsl:with-param name="base.dir">
  490. <xsl:if test="$manifest.in.base.dir = 0">
  491. <xsl:value-of select="$base.dir"/>
  492. </xsl:if>
  493. </xsl:with-param>
  494. <xsl:with-param name="base.name">
  495. <xsl:apply-templates mode="chunk-filename" select="."/>
  496. </xsl:with-param>
  497. </xsl:call-template>
  498. <xsl:text>
  499. </xsl:text>
  500. </xsl:if>
  501. <xsl:apply-templates select="*" mode="enumerate-files"/>
  502. </xsl:template>
  503. <xsl:template match="book/index|article/index|part/index" mode="enumerate-files">
  504. <xsl:if test="$htmlhelp.output != 1">
  505. <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
  506. <xsl:if test="$ischunk='1'">
  507. <xsl:call-template name="make-relative-filename">
  508. <xsl:with-param name="base.dir">
  509. <xsl:if test="$manifest.in.base.dir = 0">
  510. <xsl:value-of select="$base.dir"/>
  511. </xsl:if>
  512. </xsl:with-param>
  513. <xsl:with-param name="base.name">
  514. <xsl:apply-templates mode="chunk-filename" select="."/>
  515. </xsl:with-param>
  516. </xsl:call-template>
  517. <xsl:text>
  518. </xsl:text>
  519. </xsl:if>
  520. <xsl:apply-templates select="*" mode="enumerate-files"/>
  521. </xsl:if>
  522. </xsl:template>
  523. <xsl:template match="legalnotice" mode="enumerate-files">
  524. <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
  525. <xsl:if test="$generate.legalnotice.link != 0">
  526. <xsl:call-template name="make-relative-filename">
  527. <xsl:with-param name="base.dir">
  528. <xsl:if test="$manifest.in.base.dir = 0">
  529. <xsl:value-of select="$base.dir"/>
  530. </xsl:if>
  531. </xsl:with-param>
  532. <xsl:with-param name="base.name">
  533. <xsl:apply-templates mode="chunk-filename" select="."/>
  534. </xsl:with-param>
  535. </xsl:call-template>
  536. <xsl:text>
  537. </xsl:text>
  538. </xsl:if>
  539. </xsl:template>
  540. <xsl:template match="mediaobject[imageobject] | inlinemediaobject[imageobject]" mode="enumerate-files">
  541. <xsl:variable name="longdesc.uri">
  542. <xsl:call-template name="longdesc.uri">
  543. <xsl:with-param name="mediaobject" select="."/>
  544. </xsl:call-template>
  545. </xsl:variable>
  546. <xsl:variable name="mediaobject" select="."/>
  547. <xsl:if test="$html.longdesc != 0 and $mediaobject/textobject[not(phrase)]">
  548. <xsl:call-template name="longdesc.uri">
  549. <xsl:with-param name="mediaobject" select="$mediaobject"/>
  550. </xsl:call-template>
  551. <xsl:text>
  552. </xsl:text>
  553. </xsl:if>
  554. </xsl:template>
  555. <xsl:template match="text()" mode="enumerate-files">
  556. </xsl:template>
  557. </xsl:stylesheet>