p5dg.filepath.xsl 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:p5dg="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/documentation_generator/documentation_generator.xsd"
  5. xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  6. xmlns:SystemObjects__x3A__File="https://biuro.biall-net.pl/wfs/default_db/SystemObjects/File.xsd"
  7. xmlns:p5ant-interface-resp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/ant_interface/ant_interface-resp.xsd"
  8. xmlns:p5ant="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd"
  9. xmlns:object_merge_ant_object="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/object_merge_ant_object.xsd"
  10. xmlns:p5dkp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd"
  11. exclude-result-prefixes="xs"
  12. version="2.0">
  13. <xsl:output indent="yes"/>
  14. <xsl:strip-space elements="*"/>
  15. <!--<xsl:import-schema schema-location="repository/p5dg.documentation.files.antstructure-resp.xsd" namespace="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/ant_interface/ant_interface-resp.xsd"/>-->
  16. <xsl:function name="p5dg:filepath.clean">
  17. <xsl:param name="p5dg:filepath"/>
  18. <xsl:variable name="clean" select="replace($p5dg:filepath,'//','/')"/>
  19. <xsl:variable name="out">
  20. <xsl:for-each select="tokenize($clean,'/')">
  21. <xsl:choose>
  22. <!--<xsl:when test="position() = 1 and string-length(.) &gt; 0">
  23. <xsl:value-of select="concat('/',.)"/>
  24. </xsl:when>-->
  25. <xsl:when test="position() = last() and string-length(.) = 0">
  26. <xsl:value-of select="."/>
  27. </xsl:when>
  28. <xsl:otherwise >
  29. <xsl:value-of select="concat('/',.)"/>
  30. </xsl:otherwise>
  31. </xsl:choose>
  32. </xsl:for-each>
  33. </xsl:variable>
  34. <xsl:value-of select="replace($out,'//','/')"/>
  35. </xsl:function>
  36. <xsl:function name="p5dg:filepath.dir">
  37. <xsl:param name="p5dg:filepath"/>
  38. <xsl:variable name="out">
  39. <xsl:for-each select="tokenize($p5dg:filepath,'/')[ position() &lt; count(tokenize($p5dg:filepath,'/'))]">
  40. <xsl:choose>
  41. <xsl:when test="position() = last()">
  42. <xsl:value-of select="."/>
  43. </xsl:when>
  44. <xsl:otherwise>
  45. <xsl:value-of select="concat(.,'/')"/>
  46. </xsl:otherwise>
  47. </xsl:choose>
  48. </xsl:for-each>
  49. </xsl:variable>
  50. <xsl:value-of select="$out"/>
  51. </xsl:function>
  52. <xsl:function name="p5dg:filepath.dir">
  53. <xsl:param name="p5dg:filepath"/>
  54. <xsl:param name="p5dg.documentation.files.index.root_dir"/>
  55. <xsl:value-of select="p5dg:filepath.clean(p5dg:filepath.dir.task($p5dg:filepath,$p5dg.documentation.files.index.root_dir))"/>
  56. </xsl:function>
  57. <xsl:function name="p5dg:filepath.dir.task">
  58. <xsl:param name="p5dg:filepath"/>
  59. <xsl:param name="p5dg.documentation.files.index.root_dir"/>
  60. <xsl:variable name="out">
  61. <xsl:value-of select="$p5dg.documentation.files.index.root_dir"/><xsl:value-of select="'/'"/>
  62. <xsl:for-each select="tokenize($p5dg:filepath,'/')[ position() &lt; count(tokenize($p5dg:filepath,'/'))]">
  63. <xsl:choose>
  64. <xsl:when test="position() = last()">
  65. <xsl:value-of select="."/>
  66. </xsl:when>
  67. <xsl:otherwise>
  68. <xsl:value-of select="concat(.,'/')"/>
  69. </xsl:otherwise>
  70. </xsl:choose>
  71. </xsl:for-each>
  72. </xsl:variable>
  73. <xsl:value-of select="$out"/>
  74. </xsl:function>
  75. <xsl:function name="p5dg:filename">
  76. <xsl:param name="p5dg:filepath"/>
  77. <xsl:value-of select="tokenize($p5dg:filepath,'/')[ position() = count(tokenize($p5dg:filepath,'/'))]"/>
  78. </xsl:function>
  79. <xsl:function name="p5dg:filename.noext">
  80. <xsl:param name="p5dg:filepath"/>
  81. <xsl:variable name="out">
  82. <xsl:for-each select="tokenize(p5dg:filename($p5dg:filepath),'\.')">
  83. <xsl:choose>
  84. <xsl:when test="position()=1 and position()=last()">
  85. <xsl:value-of select="."/>
  86. </xsl:when>
  87. <xsl:when test="position()=last()"></xsl:when>
  88. <xsl:when test="position()=(last() -1 )">
  89. <xsl:value-of select="."/>
  90. </xsl:when>
  91. <xsl:otherwise>
  92. <xsl:value-of select="."/><xsl:text>.</xsl:text>
  93. </xsl:otherwise>
  94. </xsl:choose>
  95. </xsl:for-each>
  96. </xsl:variable>
  97. <xsl:copy-of select="$out"/>
  98. </xsl:function>
  99. <xsl:function name="p5dkp:ditafiles.file_from_fullpath.rel">
  100. <xsl:param name="fullpath"/>
  101. <xsl:variable name="out">
  102. <xsl:for-each select="tokenize($fullpath,'/')">
  103. <xsl:choose>
  104. <xsl:when test="position() = 1">
  105. <xsl:value-of select="concat(.,'/')"/>
  106. </xsl:when>
  107. <xsl:when test="position() = last()">
  108. <xsl:value-of select="concat(.,'/')"/>
  109. </xsl:when>
  110. <xsl:otherwise>
  111. <xsl:value-of select="concat(.,'/')"/>
  112. </xsl:otherwise>
  113. </xsl:choose>
  114. </xsl:for-each>
  115. </xsl:variable>
  116. <xsl:value-of select="p5dg:filepath.clean($out)"/>
  117. </xsl:function>
  118. <xsl:function name="p5dkp:ditafiles.file_from_fullpath">
  119. <xsl:param name="fullpath"/>
  120. <xsl:variable name="path_len" select="count(tokenize($fullpath,'/'))"/>
  121. <xsl:variable name="out">
  122. <xsl:choose>
  123. <xsl:when test="$path_len &gt; 0">
  124. <xsl:for-each select="tokenize($fullpath,'/')">
  125. <xsl:choose>
  126. <xsl:when test="position() = last()">
  127. <xsl:value-of select="."/>
  128. </xsl:when>
  129. </xsl:choose>
  130. </xsl:for-each>
  131. </xsl:when>
  132. <xsl:otherwise>
  133. <xsl:value-of select="$fullpath"/>
  134. </xsl:otherwise>
  135. </xsl:choose>
  136. </xsl:variable>
  137. <xsl:value-of select="$out"/>
  138. </xsl:function>
  139. <xsl:function name="p5dkp:ditafiles.dir_from_fullpath">
  140. <xsl:param name="fullpath"/>
  141. <!--<xsl:message>#98 <xsl:value-of select="$fullpath"/></xsl:message>-->
  142. <xsl:variable name="path_len" select="count(tokenize($fullpath,'/'))"/>
  143. <xsl:variable name="out">
  144. <xsl:choose>
  145. <xsl:when test="$path_len &gt; 0">
  146. <xsl:for-each select="tokenize($fullpath,'/')">
  147. <xsl:choose>
  148. <xsl:when test="position() = 1">
  149. <xsl:value-of select="concat(.,'/')"/>
  150. </xsl:when>
  151. <xsl:when test="position() &lt; $path_len and not(position() = last())">
  152. <xsl:value-of select="concat(.,'/')"/>
  153. </xsl:when>
  154. </xsl:choose>
  155. </xsl:for-each>
  156. </xsl:when>
  157. </xsl:choose>
  158. </xsl:variable>
  159. <xsl:value-of select="$out"/>
  160. </xsl:function>
  161. <xsl:function name="p5dkp:ditafiles.func.merge_path.string.file">
  162. <xsl:param name="map.path1"/>
  163. <xsl:param name="href1"/>
  164. <xsl:param name="map.path2"/>
  165. <xsl:param name="href2"/>
  166. <xsl:value-of select="concat(p5dkp:ditafiles.func.merge_path.string($map.path1,$href1,$map.path2,$href2),'/',$href1)"/>
  167. </xsl:function>
  168. <xsl:function name="p5dkp:ditafiles.func.merge_path.string">
  169. <xsl:param name="map.path1"/>
  170. <xsl:param name="href1"/>
  171. <xsl:param name="map.path2"/>
  172. <xsl:param name="href2"/>
  173. <xsl:variable name="p5dkp:ditafiles.func.merge_path">
  174. <p5dkp:ditafiles.func.merge_path>
  175. <xsl:copy-of select="p5dkp:ditafiles.func.merge_path($map.path1,$href1,$map.path2,$href2)" copy-namespaces="no"/>
  176. </p5dkp:ditafiles.func.merge_path>
  177. </xsl:variable>
  178. <xsl:variable name="merge_path">
  179. <xsl:for-each select="$p5dkp:ditafiles.func.merge_path//result/path">
  180. <xsl:choose>
  181. <xsl:when test="position() = last() and string-length(@path) &gt; 0">
  182. <xsl:value-of select="@path"/>
  183. </xsl:when>
  184. <xsl:otherwise><xsl:value-of select="concat(@path,'/')"/></xsl:otherwise>
  185. </xsl:choose>
  186. </xsl:for-each>
  187. </xsl:variable>
  188. <xsl:value-of select="$merge_path"/>
  189. </xsl:function>
  190. <xsl:function name="p5dkp:ditafiles.func.merge_path.string">
  191. <xsl:param name="map.path1"/>
  192. <xsl:param name="map.path2"/>
  193. <xsl:variable name="p5dkp:ditafiles.func.merge_path">
  194. <p5dkp:ditafiles.func.merge_path>
  195. <xsl:copy-of select="p5dkp:ditafiles.func.merge_path($map.path1,'/FAKEFILE1.FAKE',$map.path2,'/FAKEFILE2.FAKE')" copy-namespaces="no"/>
  196. </p5dkp:ditafiles.func.merge_path>
  197. </xsl:variable>
  198. <xsl:variable name="merge_path">
  199. <xsl:for-each select="$p5dkp:ditafiles.func.merge_path//result/path">
  200. <xsl:choose>
  201. <xsl:when test="position() = last()">
  202. <xsl:value-of select="@path"/>
  203. </xsl:when>
  204. <xsl:otherwise><xsl:value-of select="concat(@path,'/')"/></xsl:otherwise>
  205. </xsl:choose>
  206. </xsl:for-each>
  207. </xsl:variable>
  208. <xsl:value-of select="$merge_path"/>
  209. </xsl:function>
  210. <xsl:function name="p5dkp:ditafiles.func.merge_path">
  211. <xsl:param name="map.path2"/>
  212. <xsl:param name="href2"/>
  213. <xsl:param name="map.path1"/>
  214. <xsl:param name="href1"/>
  215. <xsl:variable name="map1" select="p5dg:filepath.clean(concat($map.path1,'/',$href1))"/>
  216. <xsl:variable name="map2" select="p5dg:filepath.clean(concat($map.path2,'/',$href2))"/>
  217. <xsl:message>[EEE]#148DDDD $map.path1 = "<xsl:value-of select="$map.path1"/>" ; "<xsl:value-of select="$href1"/>" $map.path2 = "<xsl:value-of select="$map.path2"/>" ; "<xsl:value-of select="$href2"/>" , count(<xsl:value-of select="count($map.path2)"/>); (<xsl:value-of select="count($href2)"/>)</xsl:message>
  218. <xsl:message>[EEE]#148DDDD-B $map1=<xsl:value-of select="$map1"/>; $map2=<xsl:value-of select="$map2"/>;</xsl:message>
  219. <xsl:variable name="p5dkp:ditafiles.func.merge_path">
  220. <p5dkp:ditafiles.func.merge_path>
  221. <xsl:variable name="map2.len" select="count(tokenize($map2,'/'))"/>
  222. <xsl:attribute name="p5dg:filepath.clean.1" select="$map1"/>
  223. <xsl:attribute name="p5dg:filepath.clean.2" select="$map2"/>
  224. <xsl:attribute name="map.path1" select="$map.path1"/>
  225. <xsl:attribute name="href1" select="$href1"/>
  226. <xsl:attribute name="map.path2" select="$map.path2"/>
  227. <xsl:attribute name="href2" select="$href2"/>
  228. <xsl:for-each select="tokenize($map1,'/')">
  229. <xsl:variable name="pos1" select="position()"/>
  230. <xsl:variable name="text1" select="."/>
  231. <xsl:choose>
  232. <xsl:when test="position() &gt; $map2.len">
  233. <path1 pos="{xs:integer($pos1)}">
  234. <xsl:attribute name="mismatch" select="."/>
  235. </path1>
  236. </xsl:when>
  237. <xsl:otherwise>
  238. <path1 pos="{xs:integer($pos1)}">
  239. <!--<xsl:message>#148 $map.path1 = "<xsl:value-of select="$map.path1"/>" ; "<xsl:value-of select="$href1"/>" $map.path2 = "<xsl:value-of select="$map.path2"/>" ; "<xsl:value-of select="$href2"/>" , count(<xsl:value-of select="count($map.path2)"/>); (<xsl:value-of select="count($href2)"/>)</xsl:message>-->
  240. <xsl:for-each select="tokenize($map2,'/')">
  241. <xsl:choose>
  242. <xsl:when test="position() = $pos1">
  243. <xsl:choose>
  244. <xsl:when test=". = $text1">
  245. <xsl:attribute name="same" select="$text1"/>
  246. </xsl:when>
  247. <xsl:otherwise>
  248. <xsl:attribute name="mismatch" select="$text1"/>
  249. </xsl:otherwise>
  250. </xsl:choose>
  251. </xsl:when>
  252. </xsl:choose>
  253. </xsl:for-each>
  254. </path1>
  255. </xsl:otherwise>
  256. </xsl:choose>
  257. </xsl:for-each>
  258. </p5dkp:ditafiles.func.merge_path>
  259. </xsl:variable>
  260. <xsl:variable name="p5dkp:ditafiles.func.merge_path2">
  261. <p5dkp:ditafiles.func.merge_path2>
  262. <xsl:variable name="map1.len" select="count(tokenize($map1,'/'))"/>
  263. <xsl:for-each select="tokenize($map2,'/')">
  264. <xsl:variable name="pos2" select="position()"/>
  265. <xsl:variable name="text2" select="."/>
  266. <xsl:choose>
  267. <xsl:when test="position() &gt; $map1.len">
  268. <path2 pos="{xs:integer($pos2)}">
  269. <xsl:attribute name="mismatch" select="."/>
  270. </path2>
  271. </xsl:when>
  272. <xsl:otherwise>
  273. <path2 pos="{xs:integer($pos2)}">
  274. <xsl:for-each select="tokenize($map1,'/')">
  275. <xsl:choose>
  276. <xsl:when test="position() = $pos2">
  277. <xsl:choose>
  278. <xsl:when test=". = $text2">
  279. <xsl:attribute name="same" select="$text2"/>
  280. </xsl:when>
  281. <xsl:otherwise>
  282. <xsl:attribute name="mismatch" select="$text2"/>
  283. </xsl:otherwise>
  284. </xsl:choose>
  285. </xsl:when>
  286. </xsl:choose>
  287. </xsl:for-each>
  288. </path2>
  289. </xsl:otherwise>
  290. </xsl:choose>
  291. </xsl:for-each>
  292. </p5dkp:ditafiles.func.merge_path2>
  293. </xsl:variable>
  294. <xsl:copy-of select="$p5dkp:ditafiles.func.merge_path" copy-namespaces="no"/>
  295. <xsl:copy-of select="$p5dkp:ditafiles.func.merge_path2" copy-namespaces="no"/>
  296. <xsl:variable name="min.mismatch" > <!-- select="min($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) cast as xs:integer " -->
  297. <xsl:choose>
  298. <xsl:when test="$p5dkp:ditafiles.func.merge_path//path1[@mismatch]/@pos">
  299. <xsl:value-of select="min($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) cast as xs:integer "/>
  300. </xsl:when>
  301. <xsl:otherwise>
  302. <xsl:value-of select="0"/>
  303. <xsl:message terminate="no">###273 same path?! situation path1= <xsl:copy-of select="$p5dkp:ditafiles.func.merge_path//path1"></xsl:copy-of></xsl:message>
  304. </xsl:otherwise>
  305. </xsl:choose>
  306. </xsl:variable>
  307. <xsl:variable name="max.mismatch" >
  308. <xsl:choose>
  309. <xsl:when test="not($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/@pos)">
  310. <xsl:value-of select="0"/>
  311. <xsl:message>#282 same path?! WARNING </xsl:message>
  312. </xsl:when>
  313. <!--<xsl:when test="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) ) cast as xs:integer &gt; max($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) cast as xs:integer ">
  314. <xsl:value-of select="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) ) cast as xs:integer "/>
  315. </xsl:when>-->
  316. <xsl:otherwise >
  317. <xsl:value-of select="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) ) cast as xs:integer "/>
  318. </xsl:otherwise>
  319. <!--<xsl:otherwise>
  320. <xsl:value-of select="max($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) cast as xs:integer "/>
  321. </xsl:otherwise>-->
  322. </xsl:choose>
  323. </xsl:variable>
  324. <xsl:variable name="max.mismatch.2" >
  325. <xsl:choose>
  326. <xsl:when test="not($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/@pos)">
  327. <xsl:value-of select="0"/>
  328. <xsl:message>#282 same path?! WARNING </xsl:message>
  329. </xsl:when>
  330. <!--<xsl:when test="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) ) cast as xs:integer &gt; max($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) cast as xs:integer ">
  331. <xsl:value-of select="max(($p5dkp:ditafiles.func.merge_path//path1[@mismatch]/number(@pos)) ) cast as xs:integer "/>
  332. </xsl:when>-->
  333. <xsl:otherwise >
  334. <xsl:value-of select="max(($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) ) cast as xs:integer "/>
  335. </xsl:otherwise>
  336. <!--<xsl:otherwise>
  337. <xsl:value-of select="max($p5dkp:ditafiles.func.merge_path2//path2[@mismatch]/number(@pos)) cast as xs:integer "/>
  338. </xsl:otherwise>-->
  339. </xsl:choose>
  340. </xsl:variable>
  341. <xsl:variable name="map.path1.len">
  342. <xsl:choose>
  343. <xsl:when test="count(tokenize($map1,'/')) &gt; 0 " >
  344. <xsl:value-of select="count(tokenize($map1,'/')) cast as xs:string"/>
  345. </xsl:when>
  346. <xsl:otherwise><xsl:value-of select="0"/></xsl:otherwise>
  347. </xsl:choose>
  348. </xsl:variable>
  349. <xsl:variable name="map.path2.len">
  350. <xsl:choose>
  351. <xsl:when test="count(tokenize($map2,'/')) &gt; 0 " >
  352. <xsl:value-of select="count(tokenize($map2,'/')) cast as xs:string"/>
  353. </xsl:when>
  354. <xsl:otherwise><xsl:value-of select="0"/></xsl:otherwise>
  355. </xsl:choose>
  356. </xsl:variable>
  357. <xsl:variable name="max.path.len" >
  358. <xsl:for-each select="($map.path1.len,$map.path2.len)">
  359. <xsl:sort select="." order="descending" data-type="number"/>
  360. <xsl:if test="position() = 1"><xsl:value-of select=". cast as xs:integer"/></xsl:if>
  361. </xsl:for-each>
  362. </xsl:variable>
  363. <result>
  364. <xsl:attribute name="min.mismatch" select="$min.mismatch" />
  365. <xsl:attribute name="max.mismatch" select="$max.mismatch" />
  366. <xsl:attribute name="max.mismatch.2" select="$max.mismatch.2" />
  367. <xsl:attribute name="map.path1.len" select="$map.path1.len"/>
  368. <xsl:attribute name="map.path2.len" select="$map.path2.len"/>
  369. <xsl:attribute name="max.path.len" select="$max.path.len"/>
  370. <!--<xsl:message>#max.path.len = <xsl:value-of select="$max.path.len"/> ; $map.path1.len = <xsl:value-of select="$map.path1.len"/>; $map.path2.len = <xsl:value-of select="$map.path2.len"/>; </xsl:message>-->
  371. <xsl:variable name="source.file.tune">
  372. <xsl:choose>
  373. <xsl:when test="string-length($href1) &gt; 0">
  374. <xsl:value-of select="1"/>
  375. </xsl:when>
  376. <xsl:otherwise>
  377. <xsl:value-of select="1"/>
  378. </xsl:otherwise>
  379. </xsl:choose>
  380. </xsl:variable>
  381. <xsl:for-each select="$min.mismatch to ( xs:integer($max.mismatch ) - xs:integer($source.file.tune))"> <!-- - 1 -->
  382. <path>
  383. <xsl:attribute name="pos" select="position()"/>
  384. <xsl:attribute name="path" select="'..'"/>
  385. <xsl:attribute name="ind" select="."/>
  386. </path>
  387. </xsl:for-each>
  388. <xsl:for-each select="$min.mismatch to ( xs:integer($max.mismatch.2 ))">
  389. <xsl:choose>
  390. <xsl:when test="$p5dkp:ditafiles.func.merge_path2//path2[ matches(concat('III',@pos,'III'),xs:string(concat('III',current(),'III'))) ]/@mismatch">
  391. <path>
  392. <xsl:attribute name="pos" select="position()"/>
  393. <xsl:attribute name="path" select="$p5dkp:ditafiles.func.merge_path2//path2[ matches(concat('III',@pos,'III'),xs:string(concat('III',current(),'III'))) ]/@mismatch" />
  394. <xsl:attribute name="ind" select="."/>
  395. <!--<xsl:attribute name="path22" select="$p5dkp:ditafiles.func.merge_path2//path2[@pos=$min.mismatch.pos]/@mismatch"/>
  396. <xsl:attribute name="path22" select="$p5dkp:ditafiles.func.merge_path2//path2[@pos=$min.mismatch.pos]/@mismatch"/>-->
  397. </path>
  398. </xsl:when>
  399. <xsl:otherwise>
  400. <else>
  401. <xsl:attribute name="pos" select="position()"/>
  402. <xsl:attribute name="path" select="$p5dkp:ditafiles.func.merge_path2//path2[ @pos = current() ]/@mismatch" />
  403. <xsl:attribute name="ind" select="."/>
  404. </else>
  405. </xsl:otherwise>
  406. </xsl:choose>
  407. </xsl:for-each>
  408. <!--<xsl:for-each select="$p5dkp:ditafiles.func.merge_path//path[number(@pos) &lt; $min.mismatch]">
  409. </xsl:for-each>-->
  410. </result>
  411. </xsl:function>
  412. </xsl:stylesheet>