profile-chunk-code.xsl 22 KB

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