profile-chunk-code.xsl 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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://docbook.sf.net/release/xsl/current/ for
  12. copyright 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="pi.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 not($generate.legalnotice.link = 0)">
  69. <xsl:choose>
  70. <xsl:when test="(@id or @xml:id) and not($use.id.as.filename = 0)">
  71. <!-- * if this legalnotice has an ID, then go ahead and use -->
  72. <!-- * just the value of that ID as the basename for the file -->
  73. <!-- * (that is, without prepending an "ln-" too it) -->
  74. <xsl:value-of select="(@id|@xml:id)[1]"/>
  75. <xsl:value-of select="$html.ext"/>
  76. </xsl:when>
  77. <xsl:otherwise>
  78. <!-- * otherwise, if this legalnotice does not have an ID, -->
  79. <!-- * then we generate an ID... -->
  80. <xsl:variable name="id">
  81. <xsl:call-template name="object.id"/>
  82. </xsl:variable>
  83. <!-- * ...and then we take that generated ID, prepend an -->
  84. <!-- * "ln-" to it, and use that as the basename for the file -->
  85. <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
  86. </xsl:otherwise>
  87. </xsl:choose>
  88. </xsl:when>
  89. <!-- if there's no dbhtml filename, and if we're to use IDs as -->
  90. <!-- filenames, then use the ID to generate the filename. -->
  91. <xsl:when test="(@id or @xml:id) and $use.id.as.filename != 0">
  92. <xsl:value-of select="(@id|@xml:id)[1]"/>
  93. <xsl:value-of select="$html.ext"/>
  94. </xsl:when>
  95. <xsl:otherwise/>
  96. </xsl:choose>
  97. </xsl:variable>
  98. <xsl:choose>
  99. <xsl:when test="$ischunk='0'">
  100. <!-- if called on something that isn't a chunk, walk up... -->
  101. <xsl:choose>
  102. <xsl:when test="count(parent::*)&gt;0">
  103. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  104. <xsl:with-param name="recursive" select="$recursive"/>
  105. </xsl:apply-templates>
  106. </xsl:when>
  107. <!-- unless there is no up, in which case return "" -->
  108. <xsl:otherwise/>
  109. </xsl:choose>
  110. </xsl:when>
  111. <xsl:when test="not($recursive) and $filename != ''">
  112. <!-- if this chunk has an explicit name, use it -->
  113. <xsl:value-of select="$filename"/>
  114. </xsl:when>
  115. <xsl:when test="self::set">
  116. <xsl:value-of select="$root.filename"/>
  117. <xsl:if test="not($recursive)">
  118. <xsl:value-of select="$html.ext"/>
  119. </xsl:if>
  120. </xsl:when>
  121. <xsl:when test="self::book">
  122. <xsl:text>bk</xsl:text>
  123. <xsl:number level="any" format="01"/>
  124. <xsl:if test="not($recursive)">
  125. <xsl:value-of select="$html.ext"/>
  126. </xsl:if>
  127. </xsl:when>
  128. <xsl:when test="self::article">
  129. <xsl:if test="/set">
  130. <!-- in a set, make sure we inherit the right book info... -->
  131. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  132. <xsl:with-param name="recursive" select="true()"/>
  133. </xsl:apply-templates>
  134. </xsl:if>
  135. <xsl:text>ar</xsl:text>
  136. <xsl:number level="any" format="01" from="book"/>
  137. <xsl:if test="not($recursive)">
  138. <xsl:value-of select="$html.ext"/>
  139. </xsl:if>
  140. </xsl:when>
  141. <xsl:when test="self::preface">
  142. <xsl:if test="/set">
  143. <!-- in a set, make sure we inherit the right book info... -->
  144. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  145. <xsl:with-param name="recursive" select="true()"/>
  146. </xsl:apply-templates>
  147. </xsl:if>
  148. <xsl:text>pr</xsl:text>
  149. <xsl:number level="any" format="01" from="book"/>
  150. <xsl:if test="not($recursive)">
  151. <xsl:value-of select="$html.ext"/>
  152. </xsl:if>
  153. </xsl:when>
  154. <xsl:when test="self::chapter">
  155. <xsl:if test="/set">
  156. <!-- in a set, make sure we inherit the right book info... -->
  157. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  158. <xsl:with-param name="recursive" select="true()"/>
  159. </xsl:apply-templates>
  160. </xsl:if>
  161. <xsl:text>ch</xsl:text>
  162. <xsl:number level="any" format="01" from="book"/>
  163. <xsl:if test="not($recursive)">
  164. <xsl:value-of select="$html.ext"/>
  165. </xsl:if>
  166. </xsl:when>
  167. <xsl:when test="self::appendix">
  168. <xsl:if test="/set">
  169. <!-- in a set, make sure we inherit the right book info... -->
  170. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  171. <xsl:with-param name="recursive" select="true()"/>
  172. </xsl:apply-templates>
  173. </xsl:if>
  174. <xsl:text>ap</xsl:text>
  175. <xsl:number level="any" format="a" 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::part">
  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>pt</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::reference">
  198. <xsl:choose>
  199. <xsl:when test="/set">
  200. <!-- in a set, make sure we inherit the right book info... -->
  201. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  202. <xsl:with-param name="recursive" select="true()"/>
  203. </xsl:apply-templates>
  204. </xsl:when>
  205. <xsl:otherwise>
  206. </xsl:otherwise>
  207. </xsl:choose>
  208. <xsl:text>rn</xsl:text>
  209. <xsl:number level="any" format="01" from="book"/>
  210. <xsl:if test="not($recursive)">
  211. <xsl:value-of select="$html.ext"/>
  212. </xsl:if>
  213. </xsl:when>
  214. <xsl:when test="self::refentry">
  215. <xsl:choose>
  216. <xsl:when test="parent::reference">
  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>re</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::colophon">
  231. <xsl:choose>
  232. <xsl:when test="/set">
  233. <!-- in a set, make sure we inherit the right book info... -->
  234. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  235. <xsl:with-param name="recursive" select="true()"/>
  236. </xsl:apply-templates>
  237. </xsl:when>
  238. <xsl:otherwise>
  239. </xsl:otherwise>
  240. </xsl:choose>
  241. <xsl:text>co</xsl:text>
  242. <xsl:number level="any" format="01" from="book"/>
  243. <xsl:if test="not($recursive)">
  244. <xsl:value-of select="$html.ext"/>
  245. </xsl:if>
  246. </xsl:when>
  247. <xsl:when test="self::sect1 or self::sect2 or self::sect3 or self::sect4 or self::sect5 or self::section">
  248. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  249. <xsl:with-param name="recursive" select="true()"/>
  250. </xsl:apply-templates>
  251. <xsl:text>s</xsl:text>
  252. <xsl:number format="01"/>
  253. <xsl:if test="not($recursive)">
  254. <xsl:value-of select="$html.ext"/>
  255. </xsl:if>
  256. </xsl:when>
  257. <xsl:when test="self::bibliography">
  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>bi</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::glossary">
  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>go</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::index">
  292. <xsl:choose>
  293. <xsl:when test="/set">
  294. <!-- in a set, make sure we inherit the right book info... -->
  295. <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
  296. <xsl:with-param name="recursive" select="true()"/>
  297. </xsl:apply-templates>
  298. </xsl:when>
  299. <xsl:otherwise>
  300. </xsl:otherwise>
  301. </xsl:choose>
  302. <xsl:text>ix</xsl:text>
  303. <xsl:number level="any" format="01" from="book"/>
  304. <xsl:if test="not($recursive)">
  305. <xsl:value-of select="$html.ext"/>
  306. </xsl:if>
  307. </xsl:when>
  308. <xsl:when test="self::setindex">
  309. <xsl:text>si</xsl:text>
  310. <xsl:number level="any" format="01" from="set"/>
  311. <xsl:if test="not($recursive)">
  312. <xsl:value-of select="$html.ext"/>
  313. </xsl:if>
  314. </xsl:when>
  315. <xsl:otherwise>
  316. <xsl:text>chunk-filename-error-</xsl:text>
  317. <xsl:value-of select="name(.)"/>
  318. <xsl:number level="any" format="01" from="set"/>
  319. <xsl:if test="not($recursive)">
  320. <xsl:value-of select="$html.ext"/>
  321. </xsl:if>
  322. </xsl:otherwise>
  323. </xsl:choose>
  324. </xsl:template>
  325. <!-- ==================================================================== -->
  326. <xsl:template match="processing-instruction('dbhtml')">
  327. <!-- nop -->
  328. </xsl:template>
  329. <!-- ==================================================================== -->
  330. <xsl:template match="*" mode="find.chunks">
  331. <xsl:variable name="chunk">
  332. <xsl:call-template name="chunk"/>
  333. </xsl:variable>
  334. <xsl:choose>
  335. <xsl:when test="$chunk != 0">
  336. <cf:div id="{generate-id()}">
  337. <xsl:apply-templates select="." mode="class.attribute"/>
  338. <xsl:apply-templates select="*" mode="find.chunks"/>
  339. </cf:div>
  340. </xsl:when>
  341. <xsl:otherwise>
  342. <xsl:apply-templates select="*" mode="find.chunks"/>
  343. </xsl:otherwise>
  344. </xsl:choose>
  345. </xsl:template>
  346. <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="/">
  347. <!-- * Get a title for current doc so that we let the user -->
  348. <!-- * know what document we are processing at this point. -->
  349. <xsl:variable name="doc.title">
  350. <xsl:call-template name="get.doc.title"/>
  351. </xsl:variable>
  352. <xsl:choose>
  353. <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
  354. toss the namespace and continue. Use the docbook5 namespaced
  355. stylesheets for DocBook5 if you don't want to use this feature.-->
  356. <!-- include extra test for Xalan quirk -->
  357. <xsl:when test="false()"/>
  358. <!-- Can't process unless namespace removed -->
  359. <xsl:when test="false()"/>
  360. <xsl:otherwise>
  361. <xsl:choose>
  362. <xsl:when test="$rootid != ''">
  363. <xsl:choose>
  364. <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
  365. <xsl:message terminate="yes">
  366. <xsl:text>ID '</xsl:text>
  367. <xsl:value-of select="$rootid"/>
  368. <xsl:text>' not found in document.</xsl:text>
  369. </xsl:message>
  370. </xsl:when>
  371. <xsl:otherwise>
  372. <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
  373. <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
  374. </xsl:if>
  375. <xsl:if test="$collect.xref.targets != 'only'">
  376. <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
  377. <xsl:if test="$tex.math.in.alt != ''">
  378. <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/>
  379. </xsl:if>
  380. <xsl:if test="$generate.manifest != 0">
  381. <xsl:call-template name="generate.manifest">
  382. <xsl:with-param name="node" select="key('id',$rootid)"/>
  383. </xsl:call-template>
  384. </xsl:if>
  385. </xsl:if>
  386. </xsl:otherwise>
  387. </xsl:choose>
  388. </xsl:when>
  389. <xsl:otherwise>
  390. <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
  391. <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
  392. </xsl:if>
  393. <xsl:if test="$collect.xref.targets != 'only'">
  394. <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
  395. <xsl:if test="$tex.math.in.alt != ''">
  396. <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
  397. </xsl:if>
  398. <xsl:if test="$generate.manifest != 0">
  399. <xsl:call-template name="generate.manifest">
  400. <xsl:with-param name="node" select="$profiled-nodes"/>
  401. </xsl:call-template>
  402. </xsl:if>
  403. </xsl:if>
  404. </xsl:otherwise>
  405. </xsl:choose>
  406. </xsl:otherwise>
  407. </xsl:choose>
  408. </xsl:template>
  409. <xsl:template match="*" mode="process.root">
  410. <xsl:apply-templates select="."/>
  411. </xsl:template>
  412. <!-- ====================================================================== -->
  413. <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">
  414. <xsl:choose>
  415. <xsl:when test="$onechunk != 0 and parent::*">
  416. <xsl:apply-imports/>
  417. </xsl:when>
  418. <xsl:otherwise>
  419. <xsl:call-template name="process-chunk-element"/>
  420. </xsl:otherwise>
  421. </xsl:choose>
  422. </xsl:template>
  423. <xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
  424. <xsl:variable name="ischunk">
  425. <xsl:call-template name="chunk"/>
  426. </xsl:variable>
  427. <xsl:choose>
  428. <xsl:when test="not(parent::*)">
  429. <xsl:call-template name="process-chunk-element"/>
  430. </xsl:when>
  431. <xsl:when test="$ischunk = 0">
  432. <xsl:apply-imports/>
  433. </xsl:when>
  434. <xsl:otherwise>
  435. <xsl:call-template name="process-chunk-element"/>
  436. </xsl:otherwise>
  437. </xsl:choose>
  438. </xsl:template>
  439. <xsl:template match="setindex |book/index |article/index |part/index">
  440. <!-- some implementations use completely empty index tags to indicate -->
  441. <!-- where an automatically generated index should be inserted. so -->
  442. <!-- if the index is completely empty, skip it. -->
  443. <xsl:if test="count(*)&gt;0 or $generate.index != '0'">
  444. <xsl:call-template name="process-chunk-element"/>
  445. </xsl:if>
  446. </xsl:template>
  447. <!-- Resolve xml:base attributes -->
  448. <xsl:template match="@fileref">
  449. <!-- need a check for absolute urls -->
  450. <xsl:choose>
  451. <xsl:when test="contains(., ':')">
  452. <!-- it has a uri scheme so it is an absolute uri -->
  453. <xsl:value-of select="."/>
  454. </xsl:when>
  455. <xsl:when test="$keep.relative.image.uris != 0">
  456. <!-- leave it alone -->
  457. <xsl:value-of select="."/>
  458. </xsl:when>
  459. <xsl:otherwise>
  460. <!-- its a relative uri -->
  461. <xsl:call-template name="relative-uri">
  462. <xsl:with-param name="destdir">
  463. <xsl:call-template name="dbhtml-dir">
  464. <xsl:with-param name="context" select=".."/>
  465. </xsl:call-template>
  466. </xsl:with-param>
  467. </xsl:call-template>
  468. </xsl:otherwise>
  469. </xsl:choose>
  470. </xsl:template>
  471. <!-- ==================================================================== -->
  472. <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">
  473. <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
  474. <xsl:if test="$ischunk='1'">
  475. <xsl:call-template name="make-relative-filename">
  476. <xsl:with-param name="base.dir">
  477. <xsl:if test="$manifest.in.base.dir = 0">
  478. <xsl:value-of select="$base.dir"/>
  479. </xsl:if>
  480. </xsl:with-param>
  481. <xsl:with-param name="base.name">
  482. <xsl:apply-templates mode="chunk-filename" select="."/>
  483. </xsl:with-param>
  484. </xsl:call-template>
  485. <xsl:text>
  486. </xsl:text>
  487. </xsl:if>
  488. <xsl:apply-templates select="*" mode="enumerate-files"/>
  489. </xsl:template>
  490. <xsl:template match="book/index|article/index|part/index" mode="enumerate-files">
  491. <xsl:if test="$htmlhelp.output != 1">
  492. <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
  493. <xsl:if test="$ischunk='1'">
  494. <xsl:call-template name="make-relative-filename">
  495. <xsl:with-param name="base.dir">
  496. <xsl:if test="$manifest.in.base.dir = 0">
  497. <xsl:value-of select="$base.dir"/>
  498. </xsl:if>
  499. </xsl:with-param>
  500. <xsl:with-param name="base.name">
  501. <xsl:apply-templates mode="chunk-filename" select="."/>
  502. </xsl:with-param>
  503. </xsl:call-template>
  504. <xsl:text>
  505. </xsl:text>
  506. </xsl:if>
  507. <xsl:apply-templates select="*" mode="enumerate-files"/>
  508. </xsl:if>
  509. </xsl:template>
  510. <xsl:template match="legalnotice" mode="enumerate-files">
  511. <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
  512. <xsl:if test="$generate.legalnotice.link != 0">
  513. <xsl:call-template name="make-relative-filename">
  514. <xsl:with-param name="base.dir">
  515. <xsl:if test="$manifest.in.base.dir = 0">
  516. <xsl:value-of select="$base.dir"/>
  517. </xsl:if>
  518. </xsl:with-param>
  519. <xsl:with-param name="base.name">
  520. <xsl:apply-templates mode="chunk-filename" select="."/>
  521. </xsl:with-param>
  522. </xsl:call-template>
  523. <xsl:text>
  524. </xsl:text>
  525. </xsl:if>
  526. </xsl:template>
  527. <xsl:template match="mediaobject[imageobject] | inlinemediaobject[imageobject]" mode="enumerate-files">
  528. <xsl:variable name="longdesc.uri">
  529. <xsl:call-template name="longdesc.uri">
  530. <xsl:with-param name="mediaobject" select="."/>
  531. </xsl:call-template>
  532. </xsl:variable>
  533. <xsl:variable name="mediaobject" select="."/>
  534. <xsl:if test="$html.longdesc != 0 and $mediaobject/textobject[not(phrase)]">
  535. <xsl:call-template name="longdesc.uri">
  536. <xsl:with-param name="mediaobject" select="$mediaobject"/>
  537. </xsl:call-template>
  538. <xsl:text>
  539. </xsl:text>
  540. </xsl:if>
  541. </xsl:template>
  542. <xsl:template match="text()" mode="enumerate-files">
  543. </xsl:template>
  544. </xsl:stylesheet>