conrefImpl.xsl 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!-- This file is part of the DITA Open Toolkit project.
  3. See the accompanying license.txt file for applicable licenses.-->
  4. <!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
  5. <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:conref="http://dita-ot.sourceforge.net/ns/200704/conref"
  6. xmlns:ditamsg="http://dita-ot.sourceforge.net/ns/200704/ditamsg"
  7. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  8. xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot"
  9. exclude-result-prefixes="ditamsg conref xs dita-ot">
  10. <xsl:import href="../common/output-message.xsl"/>
  11. <xsl:import href="../common/dita-utilities.xsl"/>
  12. <!-- Define the error message prefix identifier -->
  13. <xsl:variable name="msgprefix" select="'DOTX'"/>
  14. <xsl:param name="EXPORTFILE"/>
  15. <xsl:param name="TRANSTYPE"/>
  16. <xsl:param name="DBG" select="no"/>
  17. <xsl:param name="file-being-processed"/>
  18. <xsl:variable name="ORIGINAL-DOMAINS" select="(/*/@domains | /dita/*[@domains][1]/@domains)[1]" as="xs:string"/>
  19. <xsl:key name="id" match="*[@id]" use="@id"/>
  20. <xsl:template match="/">
  21. <xsl:apply-templates>
  22. <xsl:with-param name="conref-ids" tunnel="yes" select="()"/>
  23. </xsl:apply-templates>
  24. </xsl:template>
  25. <!-- If the target element does not exist, this template will be called to issue an error -->
  26. <xsl:template name="missing-target-error">
  27. <xsl:apply-templates select="." mode="ditamsg:missing-conref-target-error"/>
  28. </xsl:template>
  29. <!-- If an ID is duplicated, and there are 2 possible targets, issue a warning -->
  30. <xsl:template name="duplicateConrefTarget">
  31. <xsl:apply-templates select="." mode="ditamsg:duplicateConrefTarget"/>
  32. </xsl:template>
  33. <!-- Determine the relative path to a conref'ed file. Start with the path and
  34. filename. Output each single directory, and chop it off. Keep going until
  35. only the filename is left. -->
  36. <xsl:template name="find-relative-path" as="xs:string">
  37. <xsl:param name="remainingpath" as="xs:string">
  38. <xsl:choose>
  39. <xsl:when test="contains(@conref, '#')">
  40. <xsl:value-of select="substring-before(@conref, '#')"/>
  41. </xsl:when>
  42. <xsl:otherwise>
  43. <xsl:value-of select="@conref"/>
  44. </xsl:otherwise>
  45. </xsl:choose>
  46. </xsl:param>
  47. <xsl:value-of>
  48. <xsl:if test="contains($remainingpath, '/')">
  49. <xsl:value-of select="substring-before($remainingpath, '/')"/>
  50. <xsl:text>/</xsl:text>
  51. <xsl:call-template name="find-relative-path">
  52. <xsl:with-param name="remainingpath" select="substring-after($remainingpath, '/')"/>
  53. </xsl:call-template>
  54. </xsl:if>
  55. </xsl:value-of>
  56. </xsl:template>
  57. <xsl:template name="get-source-attribute" as="xs:string*">
  58. <xsl:param name="current-node" select="."/>
  59. <xsl:apply-templates select="$current-node/@*" mode="get-source-attribute"/>
  60. </xsl:template>
  61. <xsl:template match="@*" mode="get-source-attribute" as="xs:string?">
  62. <xsl:value-of select="name()"/>
  63. </xsl:template>
  64. <xsl:template match="@xtrc | @xtrf" mode="get-source-attribute" priority="10"/>
  65. <xsl:template match="@conref" mode="get-source-attribute" priority="10"/>
  66. <!-- DITA 1.1 added the key -dita-use-conref-target, which can be used on required attributes
  67. to be sure they do not override the same attribute on a target element. -->
  68. <xsl:template match="@*[. = '-dita-use-conref-target']" mode="get-source-attribute" priority="11"/>
  69. <!-- The value -dita-ues-conref-target replaces the need for the following templates, which
  70. ensured that known required attributes did not override the conref target. They are left
  71. here for completeness. -->
  72. <xsl:template match="*[contains(@class, ' topic/image ')]/@href" mode="get-source-attribute" priority="10"/>
  73. <xsl:template match="*[contains(@class, ' topic/tgroup ')]/@cols" mode="get-source-attribute" priority="10"/>
  74. <xsl:template match="*[contains(@class, ' topic/boolean ')]/@state" mode="get-source-attribute" priority="10"/>
  75. <xsl:template match="*[contains(@class, ' topic/state ')]/@name" mode="get-source-attribute" priority="10"/>
  76. <xsl:template match="*[contains(@class, ' topic/state ')]/@value" mode="get-source-attribute" priority="10"/>
  77. <xsl:template match="*[contains(@class, ' mapgroup-d/topichead ')]/@navtitle" mode="get-source-attribute" priority="10"/>
  78. <xsl:template match="@*" mode="conaction-target">
  79. <xsl:copy/>
  80. </xsl:template>
  81. <xsl:template match="@conaction | @conref" mode="conaction-target"/>
  82. <!-- When content is pushed from one topic to another, it is still rendered in the original context.
  83. Processors may delete empty the element that with the conaction="mark" attribute. -->
  84. <xsl:template match="*[@conaction]" priority="10">
  85. <xsl:choose>
  86. <xsl:when test="@conaction != 'mark'">
  87. <xsl:copy>
  88. <xsl:apply-templates select="@*" mode="conaction-target"/>
  89. <xsl:apply-templates select="node()"/>
  90. </xsl:copy>
  91. </xsl:when>
  92. </xsl:choose>
  93. </xsl:template>
  94. <!--if something has a conref attribute, jump to the target if valid and continue applying templates-->
  95. <xsl:template match="*[@conref][@conref != ''][not(@conaction)]" priority="10">
  96. <!-- If we have already followed a relative path, pick it up -->
  97. <xsl:param name="current-relative-path" tunnel="yes" as="xs:string" select="''"/>
  98. <xsl:param name="conref-source-topicid" tunnel="yes" as="xs:string?"/>
  99. <xsl:param name="source-attributes" as="xs:string*"/>
  100. <xsl:param name="conref-ids" tunnel="yes" as="xs:string*"/>
  101. <xsl:param name="WORKDIR" tunnel="yes" as="xs:string">
  102. <xsl:apply-templates select="/processing-instruction('workdir-uri')[1]" mode="get-work-dir"/>
  103. </xsl:param>
  104. <xsl:param name="original-element" as="xs:string">
  105. <xsl:call-template name="get-original-element"/>
  106. </xsl:param>
  107. <xsl:param name="original-attributes" select="@*" as="attribute()*"/>
  108. <xsl:variable name="conrefend" as="xs:string?">
  109. <xsl:choose>
  110. <xsl:when test="dita-ot:has-element-id(@conrefend)">
  111. <xsl:value-of select="dita-ot:get-element-id(@conrefend)"/>
  112. </xsl:when>
  113. <xsl:when test="contains(@conrefend, '#')">
  114. <xsl:value-of select="substring-after(@conrefend, '#')"/>
  115. </xsl:when>
  116. <xsl:when test="contains(@conrefend, '/')">
  117. <xsl:value-of select="substring-after(@conrefend, '/')"/>
  118. </xsl:when>
  119. <xsl:when test="exists(@conrefend)">
  120. <xsl:value-of select="@conrefend"/>
  121. </xsl:when>
  122. </xsl:choose>
  123. </xsl:variable>
  124. <xsl:variable name="add-relative-path" as="xs:string">
  125. <xsl:call-template name="find-relative-path"/>
  126. </xsl:variable>
  127. <!-- Add this to the list of followed conref IDs -->
  128. <xsl:variable name="updated-conref-ids" select="($conref-ids, generate-id(.))"/>
  129. <!-- Keep the source node in a variable, to pass to the target. It can be used to save
  130. attributes that were specified locally. If for some reason somebody passes from
  131. conref straight to conref, then just save the first one (in source-attributes) -->
  132. <!--get element local name, parent topic's domains, and then file name, topic id, element id from conref value-->
  133. <xsl:variable name="element" select="local-name(.)"/>
  134. <!--xsl:variable name="domains"><xsl:value-of select="ancestor-or-self::*[@domains][1]/@domains"/></xsl:variable-->
  135. <xsl:variable name="file-prefix" select="concat($WORKDIR, $current-relative-path)" as="xs:string"/>
  136. <xsl:variable name="file-origin" as="xs:string">
  137. <xsl:call-template name="get-file-uri">
  138. <xsl:with-param name="href" select="@conref"/>
  139. <xsl:with-param name="file-prefix" select="$file-prefix"/>
  140. </xsl:call-template>
  141. </xsl:variable>
  142. <xsl:variable name="file" as="xs:string">
  143. <xsl:call-template name="replace-blank">
  144. <xsl:with-param name="file-origin">
  145. <xsl:value-of select="$file-origin"/>
  146. </xsl:with-param>
  147. </xsl:call-template>
  148. </xsl:variable>
  149. <!-- get domains attribute in the target file -->
  150. <xsl:variable name="domains" select="(document($file, /)/*/@domains | document($file, /)/dita/*[@domains][1]/@domains)[1]" as="xs:string"/>
  151. <!--the file name is useful to href when resolveing conref -->
  152. <xsl:variable name="conref-filename" as="xs:string">
  153. <xsl:call-template name="replace-blank">
  154. <xsl:with-param name="file-origin" select="substring-after(substring-after($file-origin, $file-prefix), $add-relative-path)"/>
  155. </xsl:call-template>
  156. </xsl:variable>
  157. <xsl:variable name="conref-source-topic" as="xs:string">
  158. <xsl:choose>
  159. <xsl:when test="normalize-space($conref-source-topicid)">
  160. <xsl:value-of select="$conref-source-topicid"/>
  161. </xsl:when>
  162. <xsl:otherwise>
  163. <xsl:value-of select="ancestor-or-self::*[contains(@class, ' topic/topic ')][1]/@id"/>
  164. </xsl:otherwise>
  165. </xsl:choose>
  166. </xsl:variable>
  167. <!-- conref file name with relative path -->
  168. <xsl:variable name="filename" select="substring-after($file-origin, $file-prefix)"/>
  169. <!-- replace the extension name -->
  170. <xsl:variable name="FILENAME" select="concat(substring-before($filename, '.'), '.dita')"/>
  171. <xsl:variable name="topicid" select="dita-ot:get-topic-id(@conref)" as="xs:string?"/>
  172. <xsl:variable name="elemid" select="dita-ot:get-element-id(@conref)" as="xs:string?"/>
  173. <xsl:choose>
  174. <!-- exportanchors defined in topicmeta-->
  175. <xsl:when test="($TRANSTYPE = 'eclipsehelp')
  176. and (document($EXPORTFILE, /)//file[@name = $FILENAME]/id[@name = $elemid])
  177. and (document($EXPORTFILE, /)//file[@name = $FILENAME]/topicid[@name = $topicid]) ">
  178. <!-- just copy -->
  179. <xsl:copy>
  180. <xsl:apply-templates select="@* | node()">
  181. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  182. <xsl:with-param name="conref-filename" tunnel="yes" select="$conref-filename"/>
  183. <xsl:with-param name="WORKDIR" tunnel="yes" select="$WORKDIR"/>
  184. </xsl:apply-templates>
  185. </xsl:copy>
  186. </xsl:when>
  187. <!-- exportanchors defined in prolog-->
  188. <xsl:when test="($TRANSTYPE = 'eclipsehelp')
  189. and document($EXPORTFILE, /)//file[@name = $FILENAME]/topicid[@name = $topicid]/id[@name = $elemid]">
  190. <!-- just copy -->
  191. <xsl:copy>
  192. <xsl:apply-templates select="@* | node()">
  193. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  194. <xsl:with-param name="conref-filename" tunnel="yes" select="$conref-filename"/>
  195. <xsl:with-param name="WORKDIR" tunnel="yes" select="$WORKDIR"/>
  196. </xsl:apply-templates>
  197. </xsl:copy>
  198. </xsl:when>
  199. <!-- just has topic id -->
  200. <xsl:when test="empty($elemid) and ($TRANSTYPE = 'eclipsehelp')
  201. and (document($EXPORTFILE, /)//file[@name = $FILENAME]/topicid[@name = $topicid]
  202. or document($EXPORTFILE, /)//file[@name = $FILENAME]/topicid[@name = $topicid]/id[@name = $elemid])">
  203. <!-- just copy -->
  204. <xsl:copy>
  205. <xsl:apply-templates select="@* | node()">
  206. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  207. <xsl:with-param name="conref-filename" tunnel="yes" select="$conref-filename"/>
  208. <xsl:with-param name="WORKDIR" tunnel="yes" select="$WORKDIR"/>
  209. </xsl:apply-templates>
  210. </xsl:copy>
  211. </xsl:when>
  212. <xsl:otherwise>
  213. <xsl:variable name="current-element" select="."/>
  214. <!-- do as usual -->
  215. <xsl:variable name="topicpos" as="xs:string">
  216. <xsl:choose>
  217. <xsl:when test="starts-with(@conref, '#')">samefile</xsl:when>
  218. <xsl:when test="contains(@conref, '#')">otherfile</xsl:when>
  219. <xsl:otherwise>firstinfile</xsl:otherwise>
  220. </xsl:choose>
  221. </xsl:variable>
  222. <xsl:choose>
  223. <xsl:when test="$conref-ids = generate-id(.)">
  224. <xsl:apply-templates select="." mode="ditamsg:conrefLoop"/>
  225. </xsl:when>
  226. <xsl:when test="exists($elemid)
  227. or contains(@class, ' topic/topic ')
  228. or contains(@class, ' map/topicref ')
  229. or contains(/*/@class, ' map/map ')
  230. or substring-after(@conref, '#') != ''">
  231. <xsl:variable name="target-doc" as="document-node()?">
  232. <xsl:choose>
  233. <xsl:when test="$topicpos = 'samefile'">
  234. <xsl:sequence select="root(.)"/>
  235. </xsl:when>
  236. <xsl:when test="$topicpos = ('otherfile', 'firstinfile')">
  237. <xsl:sequence select="document($file, /)"/>
  238. </xsl:when>
  239. </xsl:choose>
  240. </xsl:variable>
  241. <xsl:choose>
  242. <xsl:when test="conref:isValid($domains)">
  243. <xsl:for-each select="$target-doc">
  244. <xsl:variable name="target" as="element()*">
  245. <xsl:choose>
  246. <xsl:when test="exists($elemid)">
  247. <xsl:sequence select="key('id', $elemid)[local-name() = $element][ancestor::*[contains(@class, ' topic/topic ')][1][@id = $topicid]]"/>
  248. </xsl:when>
  249. <xsl:when test="exists($topicid) and contains($current-element/@class, ' topic/topic ')">
  250. <xsl:sequence select="key('id', $topicid)[contains(@class, ' topic/topic ')][local-name() = $element]"/>
  251. </xsl:when>
  252. <xsl:when test="exists($topicid) and contains($current-element/@class, ' map/topicref ')">
  253. <xsl:sequence select="key('id', $topicid)[contains(@class, ' map/topicref ')][local-name() = $element]"/>
  254. </xsl:when>
  255. <xsl:when test="exists($topicid) and contains(root($current-element)/*/@class, ' map/map ')">
  256. <xsl:sequence select="key('id', $topicid)[local-name() = $element]"/>
  257. </xsl:when>
  258. <xsl:when test="exists($topicid)">
  259. <xsl:sequence select="key('id', $topicid)[local-name() = $element]"/>
  260. </xsl:when>
  261. <xsl:otherwise>
  262. <xsl:sequence select="//*[contains(@class, ' topic/topic ')][1][local-name() = $element]"/>
  263. </xsl:otherwise>
  264. </xsl:choose>
  265. </xsl:variable>
  266. <xsl:choose>
  267. <xsl:when test="$target">
  268. <xsl:variable name="firstTopicId" select="if (exists($topicid)) then $topicid else $target/@id"/>
  269. <xsl:choose>
  270. <!-- if the first topic id is exported and transtype is eclipsehelp-->
  271. <!-- XXX it would be good if this could be move higher up -->
  272. <xsl:when test="$TRANSTYPE = 'eclipsehelp'
  273. and empty($topicid) and empty($elemid)
  274. and document($EXPORTFILE, $current-element)//file[@name = $FILENAME]/topicid[@name = $firstTopicId]">
  275. <xsl:copy>
  276. <xsl:apply-templates select="node()">
  277. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  278. <xsl:with-param name="conref-filename" tunnel="yes" select="$conref-filename"/>
  279. <xsl:with-param name="WORKDIR" tunnel="yes" select="$WORKDIR"/>
  280. </xsl:apply-templates>
  281. </xsl:copy>
  282. </xsl:when>
  283. <xsl:otherwise>
  284. <xsl:apply-templates select="$target[1]" mode="conref-target">
  285. <xsl:with-param name="source-attributes" as="xs:string*">
  286. <xsl:choose>
  287. <xsl:when test="exists($source-attributes)">
  288. <xsl:sequence select="$source-attributes"/>
  289. </xsl:when>
  290. <xsl:otherwise>
  291. <xsl:call-template name="get-source-attribute">
  292. <xsl:with-param name="current-node" select="$current-element"/>
  293. </xsl:call-template>
  294. </xsl:otherwise>
  295. </xsl:choose>
  296. </xsl:with-param>
  297. <xsl:with-param name="current-relative-path" tunnel="yes" select="concat($current-relative-path, $add-relative-path)"/>
  298. <xsl:with-param name="WORKDIR" tunnel="yes" select="$WORKDIR"/>
  299. <xsl:with-param name="conref-filename" tunnel="yes" select="$conref-filename"/>
  300. <xsl:with-param name="conref-source-topicid" tunnel="yes" select="$conref-source-topic"/>
  301. <xsl:with-param name="conref-ids" tunnel="yes" select="$updated-conref-ids"/>
  302. <xsl:with-param name="conrefend" select="$conrefend"/>
  303. <xsl:with-param name="original-element" select="$original-element"/>
  304. <xsl:with-param name="original-attributes" select="$original-attributes"/>
  305. </xsl:apply-templates>
  306. <xsl:if test="$target[2]">
  307. <xsl:apply-templates select="." mode="ditamsg:duplicateConrefTarget"/>
  308. </xsl:if>
  309. </xsl:otherwise>
  310. </xsl:choose>
  311. </xsl:when>
  312. <xsl:otherwise>
  313. <xsl:apply-templates select="$current-element" mode="ditamsg:missing-conref-target-error"/>
  314. </xsl:otherwise>
  315. </xsl:choose>
  316. </xsl:for-each>
  317. </xsl:when>
  318. <xsl:otherwise>
  319. <xsl:apply-templates select="." mode="ditamsg:domainMismatch"/>
  320. </xsl:otherwise>
  321. </xsl:choose>
  322. </xsl:when>
  323. <xsl:otherwise>
  324. <xsl:apply-templates select="." mode="ditamsg:malformedConref"/>
  325. </xsl:otherwise>
  326. </xsl:choose>
  327. </xsl:otherwise>
  328. </xsl:choose>
  329. </xsl:template>
  330. <!-- When an element is the target of a conref, treat everything the same as any other element EXCEPT the attributes.
  331. Create the current element, and add all attributes except @id. Then go back to the original element
  332. (passed in source-attributes). Process all attributes on that element, except @conref. They will
  333. replace values in the source. -->
  334. <xsl:template match="*" mode="conref-target">
  335. <xsl:param name="WORKDIR" tunnel="yes" as="xs:string"/>
  336. <xsl:param name="source-attributes" as="xs:string*"/>
  337. <xsl:param name="current-relative-path" tunnel="yes" as="xs:string"/>
  338. <xsl:param name="conrefend" as="xs:string?"/>
  339. <xsl:param name="original-attributes" as="attribute()*"/>
  340. <xsl:param name="original-element"/>
  341. <xsl:variable name="topicid" as="xs:string?">
  342. <xsl:choose>
  343. <xsl:when test="contains(@class, ' topic/topic ')">
  344. <xsl:value-of select="@id"/>
  345. </xsl:when>
  346. <xsl:otherwise>
  347. <xsl:value-of select="ancestor::*[contains(@class, ' topic/topic ')][1]/@id"/>
  348. </xsl:otherwise>
  349. </xsl:choose>
  350. </xsl:variable>
  351. <xsl:variable name="elemid" as="xs:string?">
  352. <xsl:choose>
  353. <xsl:when test="contains(@class, ' topic/topic ')"/>
  354. <xsl:otherwise>
  355. <xsl:value-of select="@id"/>
  356. </xsl:otherwise>
  357. </xsl:choose>
  358. </xsl:variable>
  359. <xsl:choose>
  360. <!-- If for some bizarre reason you conref to another element that uses @conref, forget the original and continue here. -->
  361. <xsl:when test="@conref">
  362. <xsl:apply-templates select=".">
  363. <xsl:with-param name="original-element" select="$original-element"/>
  364. <xsl:with-param name="source-attributes" select="$source-attributes"/>
  365. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  366. <xsl:with-param name="WORKDIR" tunnel="yes" select="$WORKDIR"/>
  367. </xsl:apply-templates>
  368. </xsl:when>
  369. <xsl:otherwise>
  370. <xsl:element name="{$original-element}">
  371. <xsl:apply-templates select="$original-attributes" mode="original-attributes"/>
  372. <xsl:for-each select="@* except @id">
  373. <xsl:if test="not(name() = $source-attributes)">
  374. <xsl:choose>
  375. <xsl:when test="name() = 'href'">
  376. <xsl:apply-templates select=".">
  377. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  378. </xsl:apply-templates>
  379. </xsl:when>
  380. <xsl:otherwise>
  381. <xsl:apply-templates select=".">
  382. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  383. </xsl:apply-templates>
  384. </xsl:otherwise>
  385. </xsl:choose>
  386. </xsl:if>
  387. </xsl:for-each>
  388. <!-- Continue processing this element as any other -->
  389. <xsl:apply-templates select="node()">
  390. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  391. <xsl:with-param name="WORKDIR" tunnel="yes" select="$WORKDIR"/>
  392. </xsl:apply-templates>
  393. </xsl:element>
  394. </xsl:otherwise>
  395. </xsl:choose>
  396. <xsl:choose>
  397. <xsl:when test="exists($conrefend)">
  398. <xsl:variable name="current" as="element()" select="."/>
  399. <xsl:variable name="conrefEndNode" as="element()?"
  400. select="following-sibling::*[@id = ($conrefend)][1]"
  401. />
  402. <xsl:choose>
  403. <xsl:when test="not($conrefEndNode)">
  404. <xsl:apply-templates select="." mode="ditamsg:missing-conrefend-target-error">
  405. <xsl:with-param name="conrefend" as="xs:string" tunnel="yes" select="$conrefend"/>
  406. </xsl:apply-templates>
  407. </xsl:when>
  408. <xsl:otherwise>
  409. <xsl:for-each select="following-sibling::*[. >> $current and . &lt;&lt; $conrefEndNode], $conrefEndNode">
  410. <xsl:choose>
  411. <xsl:when test="@conref">
  412. <xsl:apply-templates select=".">
  413. <xsl:with-param name="source-attributes" select="$source-attributes"/>
  414. <xsl:with-param name="current-relative-path" select="$current-relative-path"/>
  415. <xsl:with-param name="WORKDIR" select="$WORKDIR"/>
  416. </xsl:apply-templates>
  417. </xsl:when>
  418. <xsl:otherwise>
  419. <xsl:copy>
  420. <xsl:for-each select="@*">
  421. <xsl:if test="not(local-name(.) = 'id')">
  422. <xsl:choose>
  423. <xsl:when test="name() = 'href'">
  424. <!--@href need to update, not implement currently. @href may point to local part, but if @href pull into other file,
  425. then @href couldn't work correctly. This is the reason why @href need to update. We leave it as the future work.-->
  426. <xsl:apply-templates select=".">
  427. <xsl:with-param name="current-relative-path" select="$current-relative-path"/>
  428. <xsl:with-param name="topicid" select="$topicid"/>
  429. <xsl:with-param name="elemid" select="$elemid"/>
  430. </xsl:apply-templates>
  431. </xsl:when>
  432. <xsl:otherwise>
  433. <xsl:copy/>
  434. </xsl:otherwise>
  435. </xsl:choose>
  436. </xsl:if>
  437. </xsl:for-each>
  438. <xsl:apply-templates select="* | comment() | processing-instruction() | text()">
  439. <xsl:with-param name="current-relative-path" select="$current-relative-path"/>
  440. <xsl:with-param name="topicid" select="$topicid"/>
  441. <xsl:with-param name="elemid" select="$elemid"/>
  442. <xsl:with-param name="WORKDIR" select="$WORKDIR"/>
  443. </xsl:apply-templates>
  444. </xsl:copy>
  445. </xsl:otherwise>
  446. </xsl:choose>
  447. </xsl:for-each>
  448. </xsl:otherwise>
  449. </xsl:choose>
  450. </xsl:when>
  451. <xsl:otherwise/>
  452. </xsl:choose>
  453. </xsl:template>
  454. <!-- Processing a copy of the original element, that used @conref: apply-templates on
  455. all of the attributes, though some may be filtered out. -->
  456. <xsl:template match="*" mode="original-attributes">
  457. <xsl:apply-templates select="@*" mode="original-attributes"/>
  458. </xsl:template>
  459. <xsl:template match="@*" mode="original-attributes">
  460. <xsl:copy/>
  461. </xsl:template>
  462. <!-- If an attribute is required, it must be specified on the original source element to avoid parsing errors.
  463. Such attributes should NOT be copied from the source. Conref should also not be copied.
  464. NOTE: if a new specialized element requires attributes, it should be added here. -->
  465. <!-- DITA 1.1 added the key -dita-use-conref-target, which can be used on required attributes
  466. to be sure they do not override the same attribute on a target element. -->
  467. <xsl:template match="@*[. = '-dita-use-conref-target']" mode="original-attributes" priority="11"/>
  468. <xsl:template match="@conrefend" mode="original-attributes" priority="10"/>
  469. <xsl:template match="@xtrc | @xtrf" mode="original-attributes" priority="10"/>
  470. <xsl:template match="@conref" mode="original-attributes" priority="10"/>
  471. <xsl:template match="*[contains(@class, ' topic/image ')]/@href" mode="original-attributes" priority="10"/>
  472. <xsl:template match="*[contains(@class, ' topic/tgroup ')]/@cols" mode="original-attributes" priority="10"/>
  473. <xsl:template match="*[contains(@class, ' topic/boolean ')]/@state" mode="original-attributes" priority="10"/>
  474. <xsl:template match="*[contains(@class, ' topic/state ')]/@name" mode="original-attributes" priority="10"/>
  475. <xsl:template match="*[contains(@class, ' topic/state ')]/@value" mode="original-attributes" priority="10"/>
  476. <!-- topichead is specialized from topicref, and requires @navtitle -->
  477. <xsl:template match="*[contains(@class, ' mapgroup-d/topichead ')]/@navtitle" mode="original-attributes" priority="10"/>
  478. <xsl:template match="@href">
  479. <xsl:param name="current-relative-path" tunnel="yes" as="xs:string"/>
  480. <xsl:param name="conref-filename" tunnel="yes" as="xs:string?"/>
  481. <xsl:param name="conref-ids" tunnel="yes" as="xs:string*"/>
  482. <xsl:attribute name="href">
  483. <xsl:choose>
  484. <xsl:when test="../@scope = 'external'">
  485. <xsl:value-of select="."/>
  486. </xsl:when>
  487. <xsl:when test="starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'ftp://')">
  488. <xsl:value-of select="."/>
  489. </xsl:when>
  490. <xsl:when test="starts-with(., '#')">
  491. <xsl:choose>
  492. <xsl:when test="empty($conref-filename)">
  493. <!--in the local file -->
  494. <xsl:value-of select="."/>
  495. </xsl:when>
  496. <xsl:otherwise>
  497. <!--not in the local file -->
  498. <xsl:call-template name="generate-href">
  499. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  500. </xsl:call-template>
  501. <!--experimental code -->
  502. </xsl:otherwise>
  503. </xsl:choose>
  504. </xsl:when>
  505. <xsl:otherwise>
  506. <xsl:value-of select="concat($current-relative-path, .)"/>
  507. </xsl:otherwise>
  508. </xsl:choose>
  509. </xsl:attribute>
  510. </xsl:template>
  511. <xsl:template match="@id">
  512. <xsl:param name="conref-filename" tunnel="yes" as="xs:string?"/>
  513. <xsl:attribute name="id">
  514. <xsl:choose>
  515. <xsl:when test="exists($conref-filename)">
  516. <xsl:value-of select="generate-id(..)"/>
  517. </xsl:when>
  518. <xsl:otherwise>
  519. <xsl:value-of select="."/>
  520. </xsl:otherwise>
  521. </xsl:choose>
  522. </xsl:attribute>
  523. </xsl:template>
  524. <xsl:template name="generate-href">
  525. <xsl:param name="current-relative-path" tunnel="yes" as="xs:string"/>
  526. <xsl:param name="conref-filename" tunnel="yes" as="xs:string"/>
  527. <xsl:param name="topicid" tunnel="yes" as="xs:string?"/>
  528. <xsl:param name="elemid" tunnel="yes" as="xs:string?"/>
  529. <xsl:param name="conref-source-topicid" tunnel="yes" as="xs:string?"/>
  530. <xsl:variable name="conref-topicid" as="xs:string">
  531. <xsl:choose>
  532. <xsl:when test="empty($topicid)">
  533. <xsl:value-of select="//*[contains(@class, ' topic/topic ')][1]/@id"/>
  534. </xsl:when>
  535. <xsl:otherwise>
  536. <xsl:value-of select="$topicid"/>
  537. </xsl:otherwise>
  538. </xsl:choose>
  539. </xsl:variable>
  540. <xsl:variable name="href-topicid" select="dita-ot:get-topic-id(.)" as="xs:string?"/>
  541. <xsl:variable name="href-elemid" select="dita-ot:get-element-id(.)" as="xs:string?"/>
  542. <xsl:variable name="conref-gen-id" as="xs:string">
  543. <xsl:choose>
  544. <xsl:when test="empty($elemid) or $elemid = $href-elemid">
  545. <xsl:value-of select="generate-id(key('id', $conref-topicid)[contains(@class, ' topic/topic ')]//*[@id = $href-elemid])"/>
  546. </xsl:when>
  547. <xsl:otherwise>
  548. <xsl:value-of select="generate-id(key('id', $conref-topicid)[contains(@class, ' topic/topic ')]//*[@id = $elemid]//*[@id = $href-elemid])"/>
  549. </xsl:otherwise>
  550. </xsl:choose>
  551. </xsl:variable>
  552. <xsl:variable name="href-gen-id" as="xs:string">
  553. <xsl:variable name="topic" select="key('id', $href-topicid)"/>
  554. <xsl:value-of select="generate-id($topic[contains(@class, ' topic/topic ')]//*[@id = $href-elemid][generate-id(ancestor::*[contains(@class, ' topic/topic ')][1]) = generate-id($topic)])"/>
  555. </xsl:variable>
  556. <xsl:choose>
  557. <xsl:when test="($conref-gen-id = '') or (not($conref-gen-id = $href-gen-id))">
  558. <!--href target is not in conref target -->
  559. <xsl:value-of select="$current-relative-path"/>
  560. <xsl:value-of select="$conref-filename"/>
  561. <xsl:value-of select="."/>
  562. </xsl:when>
  563. <xsl:when test="$conref-gen-id = $href-gen-id">
  564. <xsl:text>#</xsl:text>
  565. <xsl:value-of select="$conref-source-topicid"/>
  566. <xsl:text>/</xsl:text>
  567. <xsl:value-of select="$conref-gen-id"/>
  568. </xsl:when>
  569. </xsl:choose>
  570. </xsl:template>
  571. <!-- 20061018: This template generalizes domain elements, if necessary,
  572. based on @domains on the original file.
  573. Example: Element <b class="+ topic/ph hi-d/b ">, domains="(topic hi-d)"
  574. Result: The "hi-d" domain is valid, leave <b> as <b>
  575. Example: Element <b class="+ topic/ph hi-d/b ">, domains="(topic pr-d)"
  576. Result: The "hi-d" domain is NOT valid, generalize <b> to <ph>
  577. Example: Element <light-b class="+ topic/ph hi-d/b shade/light-b ">, domains="(topic hi-d)"
  578. Result: The "shade" domain is NOT valid, but "hi-d" is, so generalize <light-b> to <b>
  579. -->
  580. <xsl:template name="generalize-domain">
  581. <xsl:param name="class" select="normalize-space(substring-after(@class, '+'))"/>
  582. <xsl:param name="domains" select="$ORIGINAL-DOMAINS"/>
  583. <xsl:variable name="evaluateNext" as="xs:string?">
  584. <xsl:if test="substring-after($class, ' ') != ''">
  585. <xsl:call-template name="generalize-domain">
  586. <xsl:with-param name="class" select="substring-after($class, ' ')"/>
  587. <xsl:with-param name="domains" select="$domains"/>
  588. </xsl:call-template>
  589. </xsl:if>
  590. </xsl:variable>
  591. <xsl:choose>
  592. <xsl:when test="$evaluateNext != ''">
  593. <xsl:value-of select="$evaluateNext"/>
  594. </xsl:when>
  595. <xsl:otherwise>
  596. <xsl:variable name="testModule" select="substring-before($class, '/')"/>
  597. <xsl:variable name="testElement" as="xs:string">
  598. <xsl:choose>
  599. <xsl:when test="contains($class, ' ')">
  600. <xsl:value-of select="substring-after(substring-before($class, ' '), '/')"/>
  601. </xsl:when>
  602. <xsl:otherwise>
  603. <xsl:value-of select="substring-after($class, '/')"/>
  604. </xsl:otherwise>
  605. </xsl:choose>
  606. </xsl:variable>
  607. <xsl:choose>
  608. <xsl:when test="contains($domains, concat(' ', $testModule, ')'))">
  609. <xsl:value-of select="$testElement"/>
  610. </xsl:when>
  611. <xsl:when test="$testModule = 'topic' or $testModule = 'map'">
  612. <xsl:value-of select="$testElement"/>
  613. </xsl:when>
  614. </xsl:choose>
  615. </xsl:otherwise>
  616. </xsl:choose>
  617. </xsl:template>
  618. <!-- Match any domain element. This compares @domains in the current topic to @domains in the
  619. original topic:
  620. * If the domains match (as it would if all in the same topic), the element name stays the same
  621. * Otherwise, call generalize-domains. This ensures the element is valid in the result doc. -->
  622. <xsl:template match="*[starts-with(@class, '+ ')]">
  623. <xsl:param name="current-relative-path" tunnel="yes" as="xs:string" select="''"/>
  624. <xsl:param name="WORKDIR" tunnel="yes" as="xs:string">
  625. <xsl:apply-templates select="/processing-instruction('workdir-uri')[1]" mode="get-work-dir"/>
  626. </xsl:param>
  627. <xsl:variable name="domains" select="/*/@domains | /dita/*[@domains][1]/@domains"/>
  628. <xsl:variable name="generalizedName" as="xs:string">
  629. <xsl:choose>
  630. <xsl:when test="$domains = $ORIGINAL-DOMAINS">
  631. <xsl:value-of select="name()"/>
  632. </xsl:when>
  633. <xsl:otherwise>
  634. <xsl:call-template name="generalize-domain"/>
  635. </xsl:otherwise>
  636. </xsl:choose>
  637. </xsl:variable>
  638. <xsl:element name="{$generalizedName}">
  639. <xsl:apply-templates select="@* | node()">
  640. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  641. <xsl:with-param name="WORKDIR" tunnel="yes" select="$WORKDIR"/>
  642. </xsl:apply-templates>
  643. </xsl:element>
  644. </xsl:template>
  645. <xsl:function name="conref:isValid" as="xs:boolean">
  646. <xsl:param name="domains" as="xs:string"/>
  647. <xsl:call-template name="checkValid">
  648. <xsl:with-param name="sourceDomains" select="normalize-space($ORIGINAL-DOMAINS)"/>
  649. <xsl:with-param name="targetDomains" select="normalize-space(concat('(topic) ', $domains))"/>
  650. </xsl:call-template>
  651. </xsl:function>
  652. <xsl:template name="checkValid" as="xs:boolean">
  653. <xsl:param name="sourceDomains"/>
  654. <xsl:param name="targetDomains"/>
  655. <!-- format the out -->
  656. <xsl:variable name="output" as="xs:string">
  657. <xsl:variable name="out" as="xs:string">
  658. <xsl:value-of>
  659. <xsl:for-each select="tokenize($sourceDomains, '\)\s*?')[not(starts-with(normalize-space(.), 'a'))]">
  660. <xsl:value-of select="concat(., ') ')"/>
  661. </xsl:for-each>
  662. </xsl:value-of>
  663. </xsl:variable>
  664. <xsl:value-of select="normalize-space($out)"/>
  665. </xsl:variable>
  666. <!-- break string into node-set -->
  667. <xsl:variable name="subDomains" select="reverse(tokenize($output, '\(|\)\s*?\(|\)'))"/>
  668. <!-- get domains value having constraints e.g [topic simpleSection-c]-->
  669. <xsl:variable name="constraints" select="$subDomains[contains(., '-c')]"/>
  670. <xsl:choose>
  671. <!-- no more constraints -->
  672. <xsl:when test="empty($constraints)">
  673. <xsl:sequence select="true()"/>
  674. </xsl:when>
  675. <xsl:otherwise>
  676. <!--get first item in the constraints node set-->
  677. <xsl:variable name="compareItem" select="$constraints[position() = 1]"/>
  678. <!-- format the item -->
  679. <!--e.g (topic hi-d basicHighlight-c)-->
  680. <xsl:variable name="constraintItem" select="concat('(', $compareItem, ')')"/>
  681. <!--find out what the original module is. e.g topic, hi-d-->
  682. <xsl:variable name="originalItem" select="tokenize($compareItem, ' ')[not(contains(., '-c'))]"/>
  683. <!-- if $compareItem is (topic shortdescReq-c task shortdescTaskReq-c),
  684. we should remove the compatible values:shortdescReq-c-->
  685. <xsl:variable name="lastConstraint" select="tokenize($compareItem, ' ')[contains(., '-c')][position() = last()]"/>
  686. <!-- cast sequence to string for compare -->
  687. <xsl:variable name="module" select="normalize-space(string-join($originalItem, ' '))" as="xs:string"/>
  688. <!-- format the string topic hi-d remove tail space to (topic hi-d) -->
  689. <xsl:variable name="originalModule" select="concat('(', $module, ')')"/>
  690. <!--remove compatible constraints-->
  691. <xsl:variable name="editedConstraintItem" select="concat('(', $module, ' ', $lastConstraint)"/>
  692. <xsl:choose>
  693. <!-- If the target has constraint item (topic hi-d basicHighlight-c) and there is only one constraint mode left-->
  694. <!-- If the target has a value that begins with constraint item and there is only one constraint mode left-->
  695. <xsl:when test="(contains($targetDomains, $constraintItem) and count($constraints) = 1)
  696. or (contains($targetDomains, $editedConstraintItem) and count($constraints) = 1) ">
  697. <xsl:sequence select="true()"/>
  698. </xsl:when>
  699. <xsl:when test="count($constraints) > 1 and (contains($targetDomains, $constraintItem) or
  700. contains($targetDomains, $editedConstraintItem) ) ">
  701. <xsl:variable name="remainString" as="xs:string">
  702. <xsl:value-of>
  703. <xsl:for-each select="remove($constraints, 1)">
  704. <xsl:value-of select="concat('s(', ., ')' , ' ')"/>
  705. </xsl:for-each>
  706. </xsl:value-of>
  707. </xsl:variable>
  708. <xsl:call-template name="checkValid">
  709. <xsl:with-param name="sourceDomains" select="normalize-space($remainString)"/>
  710. <xsl:with-param name="targetDomains" select="$targetDomains"/>
  711. </xsl:call-template>
  712. </xsl:when>
  713. <!--If the target does not have (topic hi-d) and (topic hi-d, continue to test #2-->
  714. <xsl:when test="not(contains($targetDomains, $originalModule)) and not(contains($targetDomains, substring-before($originalModule, ')' )))">
  715. <xsl:variable name="remainString" as="xs:string">
  716. <xsl:value-of>
  717. <xsl:for-each select="remove($constraints, 1)">
  718. <xsl:value-of select="concat('s(', ., ')' , ' ')"/>
  719. </xsl:for-each>
  720. </xsl:value-of>
  721. </xsl:variable>
  722. <xsl:call-template name="checkValid">
  723. <xsl:with-param name="sourceDomains" select="normalize-space($remainString)"/>
  724. <xsl:with-param name="targetDomains" select="$targetDomains"/>
  725. </xsl:call-template>
  726. </xsl:when>
  727. <!--If the target topic has the original module (topic hi-d) but does not have constraintItem (topic hi-d basicHighlight-c)
  728. or If the target topic has the beginning original module (topic hi-d but does not have constraintItem (topic hi-d basicHighlight-c)-->
  729. <!--conref is not allowed -->
  730. <xsl:when test="(contains($targetDomains, $originalModule) and not(contains($targetDomains, $constraintItem)))
  731. or (contains($targetDomains, substring-before($originalModule, ')' )) and not(contains($targetDomains, $constraintItem)))">
  732. <xsl:sequence select="false()"/>
  733. </xsl:when>
  734. </xsl:choose>
  735. </xsl:otherwise>
  736. </xsl:choose>
  737. </xsl:template>
  738. <!--copy everything else-->
  739. <xsl:template match="@* | node()">
  740. <xsl:param name="current-relative-path" tunnel="yes" as="xs:string" select="''"/>
  741. <xsl:param name="WORKDIR" tunnel="yes" as="xs:string">
  742. <xsl:apply-templates select="/processing-instruction('workdir-uri')[1]" mode="get-work-dir"/>
  743. </xsl:param>
  744. <xsl:copy>
  745. <xsl:apply-templates select="@* | node()">
  746. <xsl:with-param name="current-relative-path" tunnel="yes" select="$current-relative-path"/>
  747. <xsl:with-param name="WORKDIR" tunnel="yes" select="$WORKDIR"/>
  748. </xsl:apply-templates>
  749. </xsl:copy>
  750. </xsl:template>
  751. <xsl:template name="get-file-uri" as="xs:string">
  752. <xsl:param name="href" as="xs:string"/>
  753. <xsl:param name="file-prefix" as="xs:string"/>
  754. <xsl:choose>
  755. <xsl:when test="starts-with($href, '#')">
  756. <xsl:value-of select="base-uri()"/>
  757. </xsl:when>
  758. <xsl:otherwise>
  759. <xsl:value-of>
  760. <xsl:value-of select="$file-prefix"/>
  761. <xsl:choose>
  762. <xsl:when test="contains($href, '#')">
  763. <xsl:value-of select="substring-before($href, '#')"/>
  764. </xsl:when>
  765. <xsl:otherwise>
  766. <xsl:value-of select="$href"/>
  767. </xsl:otherwise>
  768. </xsl:choose>
  769. </xsl:value-of>
  770. </xsl:otherwise>
  771. </xsl:choose>
  772. </xsl:template>
  773. <xsl:template name="get-original-element" as="xs:string">
  774. <xsl:value-of select="local-name(.)"/>
  775. </xsl:template>
  776. <!-- If the target element does not exist, this template will be called to issue an error -->
  777. <xsl:template match="*" mode="ditamsg:missing-conref-target-error">
  778. <xsl:call-template name="output-message">
  779. <xsl:with-param name="id" select="'DOTX010E'"/>
  780. <xsl:with-param name="msgparams">%1=<xsl:value-of select="@conref"/></xsl:with-param>
  781. </xsl:call-template>
  782. </xsl:template>
  783. <!-- If the conrefend target element does not exist, this template will be called to issue an error -->
  784. <xsl:template match="*" mode="ditamsg:missing-conrefend-target-error">
  785. <xsl:param name="conrefend" as="xs:string" tunnel="yes"/>
  786. <xsl:call-template name="output-message">
  787. <xsl:with-param name="msgnum">071</xsl:with-param>
  788. <xsl:with-param name="msgsev">E</xsl:with-param>
  789. <xsl:with-param name="msgparams">%1=<xsl:value-of select="$conrefend"/></xsl:with-param>
  790. </xsl:call-template>
  791. </xsl:template>
  792. <!-- If an ID is duplicated, and there are 2 possible targets, issue a warning -->
  793. <xsl:template match="*" mode="ditamsg:duplicateConrefTarget">
  794. <xsl:call-template name="output-message">
  795. <xsl:with-param name="id" select="'DOTX011W'"/>
  796. <xsl:with-param name="msgparams">%1=<xsl:value-of select="@conref"/></xsl:with-param>
  797. </xsl:call-template>
  798. </xsl:template>
  799. <!-- Message is no longer used - appeared when domain mismatch prevented conref -->
  800. <xsl:template match="*" mode="ditamsg:domainMismatch">
  801. <xsl:call-template name="output-message">
  802. <xsl:with-param name="id" select="'DOTX012W'"/>
  803. </xsl:call-template>
  804. </xsl:template>
  805. <!-- If this conref has already been followed, stop to prevent an infinite loop -->
  806. <xsl:template match="*" mode="ditamsg:conrefLoop">
  807. <xsl:call-template name="output-message">
  808. <xsl:with-param name="id" select="'DOTX013E'"/>
  809. <xsl:with-param name="msgparams">%1=<xsl:value-of select="@conref"/></xsl:with-param>
  810. </xsl:call-template>
  811. </xsl:template>
  812. <!-- Following msg is used on topicref and map -->
  813. <xsl:template match="*" mode="ditamsg:malformedConrefInMap">
  814. <xsl:call-template name="output-message">
  815. <xsl:with-param name="id" select="'DOTX014E'"/>
  816. <xsl:with-param name="msgparams">%1=<xsl:value-of select="@conref"/></xsl:with-param>
  817. </xsl:call-template>
  818. </xsl:template>
  819. <xsl:template match="*" mode="ditamsg:malformedConref">
  820. <xsl:call-template name="output-message">
  821. <xsl:with-param name="id" select="'DOTX015E'"/>
  822. <xsl:with-param name="msgparams">%1=<xsl:value-of select="@conref"/></xsl:with-param>
  823. </xsl:call-template>
  824. </xsl:template>
  825. <xsl:template match="*" mode="ditamsg:parserUnsupported">
  826. <xsl:call-template name="output-message">
  827. <xsl:with-param name="id" select="'DOTX062I'"/>
  828. </xsl:call-template>
  829. </xsl:template>
  830. </xsl:stylesheet>