profile-chunk-code.xsl 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  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. <!--This file was created automatically by xsl2profile--><!--from the DocBook XSL stylesheets. Do not edit this file.--><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">
  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. <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>Stripping NS from DocBook 5/NG document.</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="stripNS"/></xslo:variable><xslo:message>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="/">
  330. <xsl:choose>
  331. <!-- include extra test for Xalan quirk -->
  332. <xsl:when test="false()"/>
  333. <!-- Can't process unless namespace removed -->
  334. <xsl:when test="false()"/>
  335. <xsl:otherwise>
  336. <xsl:choose>
  337. <xsl:when test="$rootid != ''">
  338. <xsl:choose>
  339. <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
  340. <xsl:message terminate="yes">
  341. <xsl:text>ID '</xsl:text>
  342. <xsl:value-of select="$rootid"/>
  343. <xsl:text>' not found in document.</xsl:text>
  344. </xsl:message>
  345. </xsl:when>
  346. <xsl:otherwise>
  347. <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
  348. <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
  349. </xsl:if>
  350. <xsl:if test="$collect.xref.targets != 'only'">
  351. <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
  352. <xsl:if test="$tex.math.in.alt != ''">
  353. <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/>
  354. </xsl:if>
  355. <xsl:if test="$generate.manifest != 0">
  356. <xsl:call-template name="generate.manifest">
  357. <xsl:with-param name="node" select="key('id',$rootid)"/>
  358. </xsl:call-template>
  359. </xsl:if>
  360. </xsl:if>
  361. </xsl:otherwise>
  362. </xsl:choose>
  363. </xsl:when>
  364. <xsl:otherwise>
  365. <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
  366. <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
  367. </xsl:if>
  368. <xsl:if test="$collect.xref.targets != 'only'">
  369. <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
  370. <xsl:if test="$tex.math.in.alt != ''">
  371. <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
  372. </xsl:if>
  373. <xsl:if test="$generate.manifest != 0">
  374. <xsl:call-template name="generate.manifest">
  375. <xsl:with-param name="node" select="$profiled-nodes"/>
  376. </xsl:call-template>
  377. </xsl:if>
  378. </xsl:if>
  379. </xsl:otherwise>
  380. </xsl:choose>
  381. </xsl:otherwise>
  382. </xsl:choose>
  383. </xsl:template>
  384. <xsl:template match="*" mode="process.root">
  385. <xsl:apply-templates select="."/>
  386. </xsl:template>
  387. <!-- ====================================================================== -->
  388. <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">
  389. <xsl:choose>
  390. <xsl:when test="$onechunk != 0 and parent::*">
  391. <xsl:apply-imports/>
  392. </xsl:when>
  393. <xsl:otherwise>
  394. <xsl:call-template name="process-chunk-element"/>
  395. </xsl:otherwise>
  396. </xsl:choose>
  397. </xsl:template>
  398. <xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
  399. <xsl:variable name="ischunk">
  400. <xsl:call-template name="chunk"/>
  401. </xsl:variable>
  402. <xsl:choose>
  403. <xsl:when test="not(parent::*)">
  404. <xsl:call-template name="process-chunk-element"/>
  405. </xsl:when>
  406. <xsl:when test="$ischunk = 0">
  407. <xsl:apply-imports/>
  408. </xsl:when>
  409. <xsl:otherwise>
  410. <xsl:call-template name="process-chunk-element"/>
  411. </xsl:otherwise>
  412. </xsl:choose>
  413. </xsl:template>
  414. <xsl:template match="setindex |book/index |article/index |part/index">
  415. <!-- some implementations use completely empty index tags to indicate -->
  416. <!-- where an automatically generated index should be inserted. so -->
  417. <!-- if the index is completely empty, skip it. -->
  418. <xsl:if test="count(*)&gt;0 or $generate.index != '0'">
  419. <xsl:call-template name="process-chunk-element"/>
  420. </xsl:if>
  421. </xsl:template>
  422. <!-- Resolve xml:base attributes -->
  423. <xsl:template match="@fileref">
  424. <!-- need a check for absolute urls -->
  425. <xsl:choose>
  426. <xsl:when test="contains(., ':')">
  427. <!-- it has a uri scheme so it is an absolute uri -->
  428. <xsl:value-of select="."/>
  429. </xsl:when>
  430. <xsl:when test="$keep.relative.image.uris != 0">
  431. <!-- leave it alone -->
  432. <xsl:value-of select="."/>
  433. </xsl:when>
  434. <xsl:otherwise>
  435. <!-- its a relative uri -->
  436. <xsl:call-template name="relative-uri">
  437. <xsl:with-param name="destdir">
  438. <xsl:call-template name="dbhtml-dir">
  439. <xsl:with-param name="context" select=".."/>
  440. </xsl:call-template>
  441. </xsl:with-param>
  442. </xsl:call-template>
  443. </xsl:otherwise>
  444. </xsl:choose>
  445. </xsl:template>
  446. <!-- ==================================================================== -->
  447. <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">
  448. <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
  449. <xsl:if test="$ischunk='1'">
  450. <xsl:call-template name="make-relative-filename">
  451. <xsl:with-param name="base.dir">
  452. <xsl:if test="$manifest.in.base.dir = 0">
  453. <xsl:value-of select="$base.dir"/>
  454. </xsl:if>
  455. </xsl:with-param>
  456. <xsl:with-param name="base.name">
  457. <xsl:apply-templates mode="chunk-filename" select="."/>
  458. </xsl:with-param>
  459. </xsl:call-template>
  460. <xsl:text>
  461. </xsl:text>
  462. </xsl:if>
  463. <xsl:apply-templates select="*" mode="enumerate-files"/>
  464. </xsl:template>
  465. <xsl:template match="book/index|article/index|part/index" mode="enumerate-files">
  466. <xsl:if test="$htmlhelp.output != 1">
  467. <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
  468. <xsl:if test="$ischunk='1'">
  469. <xsl:call-template name="make-relative-filename">
  470. <xsl:with-param name="base.dir">
  471. <xsl:if test="$manifest.in.base.dir = 0">
  472. <xsl:value-of select="$base.dir"/>
  473. </xsl:if>
  474. </xsl:with-param>
  475. <xsl:with-param name="base.name">
  476. <xsl:apply-templates mode="chunk-filename" select="."/>
  477. </xsl:with-param>
  478. </xsl:call-template>
  479. <xsl:text>
  480. </xsl:text>
  481. </xsl:if>
  482. <xsl:apply-templates select="*" mode="enumerate-files"/>
  483. </xsl:if>
  484. </xsl:template>
  485. <xsl:template match="legalnotice" mode="enumerate-files">
  486. <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
  487. <xsl:if test="$generate.legalnotice.link != 0">
  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:template>
  502. <xsl:template match="mediaobject[imageobject] | inlinemediaobject[imageobject]" mode="enumerate-files">
  503. <xsl:variable name="longdesc.uri">
  504. <xsl:call-template name="longdesc.uri">
  505. <xsl:with-param name="mediaobject" select="."/>
  506. </xsl:call-template>
  507. </xsl:variable>
  508. <xsl:variable name="mediaobject" select="."/>
  509. <xsl:if test="$html.longdesc != 0 and $mediaobject/textobject[not(phrase)]">
  510. <xsl:call-template name="longdesc.uri">
  511. <xsl:with-param name="mediaobject" select="$mediaobject"/>
  512. </xsl:call-template>
  513. <xsl:text>
  514. </xsl:text>
  515. </xsl:if>
  516. </xsl:template>
  517. <xsl:template match="text()" mode="enumerate-files">
  518. </xsl:template>
  519. </xsl:stylesheet>