bcgtht.tree_to_dita.clousure.analys.xsl 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:gml="http://www.opengis.net/gml"
  5. xmlns:p5bws="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/WPS_Functions.xsd"
  6. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  7. xmlns:bcgtht="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/bocian-graph-to-html/bcgtht.xsd"
  8. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. xmlns:default_db__x3A__BI_audit_ENERGA_PRACOWNICY="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_PRACOWNICY"
  10. xmlns:p5="https://biuro.biall-net.pl/wfs"
  11. xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"
  12. xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row"
  13. xmlns:default_db__x3A__BI_audit_KRS="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS"
  14. xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI"
  15. xmlns:default_db__x3A__BI_audit_MSIG="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG"
  16. xmlns:default_db__x3A__BI_audit_CEIDG="https://biuro.biall-net.pl/wfs/default_db/BI_audit_CEIDG"
  17. xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
  18. xmlns:default_db__x3A__BI_audit_KRS_person="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS_person"
  19. xmlns:default_db__x3A__BI_audit_taxpayer="https://biuro.biall-net.pl/wfs/default_db/BI_audit_taxpayer"
  20. xmlns:default_db__x3A__BI_audit_KRS_company="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS_company"
  21. xmlns:default_db__x3A__BI_audit_MSIG_company="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_company"
  22. xmlns:default_db__x3A__TERYT_adresy="https://biuro.biall-net.pl/wfs/default_db/TERYT_adresy"
  23. xmlns:default_db__x3A__BI_audit_MSIG_person="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_person"
  24. xmlns:default_db__x3A__BI_audit_operational_raport_note="https://biuro.biall-net.pl/wfs/default_db/BI_audit_operational_raport_note"
  25. xmlns:default_db__x3A__BI_audit_MSIG_address="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_address"
  26. xmlns:p5yed="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/yed/p5yed.xsd"
  27. xmlns:p5suis="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd"
  28. xmlns:p5xmli="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xmlschema_interface/p5xmli.xsd"
  29. version="2.0">
  30. <xsl:output indent="yes"/>
  31. <xsl:strip-space elements="*"/> <!-- -->
  32. <xsl:key name="bcgtht:id" match="//path.clousure.following" use="@bcgtht:id"/> <!-- path.included -->
  33. <xsl:key name="bcgtht:clousure.from" match="//path.clousure.following" use="@bcgtht:clousure.from" />
  34. <xsl:key name="bcgtht:clousure.node" match="//path.clousure.following" use="@bcgtht:clousure.node"/>
  35. <!--<xsl:key name="bcgtht:clousure.node.from" match="path.clousure.following|path.included" use="@bcgtht:clousure.node or @bcgtht:clousure.from "/>-->
  36. <xsl:key name="bcgtht:clousure.node.from" match="//path.clousure.following" use="@bcgtht:clousure.node or @bcgtht:clousure.from "/>
  37. <xsl:param name="bcgtht.clousure.len_max" select="'999'"/>
  38. <xsl:param name="bcgtht:debug.nodes" select="'BI_audit_KRS.161323 BI_audit_KRS_person.747001 BI_audit_KRS_person.747001 BI_audit_KRS.151308'"/>
  39. <xsl:template name="bcgtht:clousure.analys">
  40. <xsl:param name="bcgtht:clousure" required="yes"/>
  41. <xsl:message>#37 template name="bcgtht:clousure.analys"</xsl:message>
  42. <!--<bcgtht:clousure.analys>
  43. <xsl:for-each-group select="$bcgtht:clousure//path.clousure.following" group-by="concat(@bcgtht:clousure.from,'-',@to.node)">
  44. <xsl:copy copy-namespaces="no">
  45. <xsl:copy-of select="@*"/>
  46. <xsl:copy-of select="bcgtht:clousure.analys.debug.child.attr(@to.node)"/>
  47. <xsl:copy-of select="bcgtht:clousure.analys.debug.child.attr(@bcgtht:clousure.from)"/>
  48. <xsl:attribute name="count" select="count(current-group())"/>
  49. <xsl:apply-templates mode="p5yed:node.attr" select="."/>
  50. <xsl:for-each select="current-group()/bcgtht:clousure.node.unique.descriptor[ position() = 1]">
  51. <xsl:sort select="count(*)" order="descending"/>
  52. <xsl:if test="position() = 1">
  53. <xsl:apply-templates mode="bcgtht:clousure.node.unique.descriptor.analys" select="."/>
  54. <!-\-<xsl:copy-of select="."/>-\->
  55. </xsl:if>
  56. </xsl:for-each>
  57. <xsl:for-each-group select="current-group()" group-by="@bcgtht:clousure.from.len">
  58. <path.included.group key="{current-grouping-key()}" count="{count(current-group())}">
  59. <!-\-<xsl:copy-of select="path.included"/>-\->
  60. <xsl:apply-templates mode="bcgtht:clousure.analys" select="path.included"/>
  61. </path.included.group>
  62. </xsl:for-each-group>
  63. </xsl:copy>
  64. </xsl:for-each-group>
  65. </bcgtht:clousure.analys>-->
  66. <bcgtht:clousure.analys>
  67. <xsl:copy-of select="p5xmli:xsi.schemaLocation($bcgtht.clousure.xsd,'http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/bocian-graph-to-html/bcgtht.xsd')"/>
  68. <xsl:apply-templates mode="bcgtht:clousure.analys" select="$bcgtht:clousure"/>
  69. </bcgtht:clousure.analys>
  70. </xsl:template>
  71. <xsl:template mode="bcgtht:clousure.analys" match="bcgtht:clousure|BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row">
  72. <xsl:apply-templates mode="#current"/>
  73. </xsl:template>
  74. <xsl:template mode="bcgtht:clousure.analys" match="path.clousure.following[number(@bcgtht:clousure.from.len) &lt;= number($bcgtht.clousure.len_max) or @bcgtht:clousure.node.pos = '0']">
  75. <xsl:copy copy-namespaces="no">
  76. <xsl:copy-of select="@*"/>
  77. <xsl:copy-of select="bcgtht:clousure.analys.debug.child.attr(@bcgtht:clousure.node)"/>
  78. <xsl:copy-of select="bcgtht:clousure.analys.debug.child.attr(@bcgtht:clousure.from)"/>
  79. <!--<xsl:apply-templates mode="p5yed:node.attr" select="."/>SSS-->
  80. <xsl:apply-templates mode="bcgtht:clousure.analys.clousure.node.unique.descriptor.neigh" select="." >
  81. <xsl:with-param name="id" select="@bcgtht:id"/>
  82. </xsl:apply-templates>
  83. <xsl:apply-templates mode="bcgtht:clousure.analys.closure" select=".">
  84. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  85. <xsl:with-param name="bcgtht:clousure.len" select="1"/>
  86. <xsl:with-param name="id" select="@bcgtht:id"/>
  87. <xsl:with-param name="bcgtht:clousure.from" select="@bcgtht:clousure.from"/>
  88. <xsl:with-param name="bcgtht:clousure.analys.log" select="bcgtht:clousure.analys.log()"/>
  89. </xsl:apply-templates>
  90. <xsl:apply-templates mode="bcgtht:clousure.analys.closure" select=".">
  91. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  92. <xsl:with-param name="bcgtht:clousure.len" select="1"/>
  93. <xsl:with-param name="id" select="@bcgtht:id"/>
  94. <xsl:with-param name="bcgtht:clousure.node" select="@bcgtht:clousure.node"/>
  95. <xsl:with-param name="bcgtht:clousure.analys.log" select="bcgtht:clousure.analys.log()"/>
  96. </xsl:apply-templates>
  97. <!-- @bcgtht:clousure.node or @bcgtht:clousure.from --> <!-- key('bcgtht:clousure.node.from', @bcgtht:clousure.node or @bcgtht:clousure.from )[ not(@bcgtht:id = current()/@bcgtht:id)] -->
  98. </xsl:copy>
  99. <xsl:apply-templates mode="#current"/>
  100. </xsl:template>
  101. <xsl:template mode="bcgtht:clousure.analys.closure" match="path.clousure.following">
  102. <xsl:param name="bcgtht:id" required="yes"/>
  103. <xsl:param name="id" />
  104. <xsl:param name="bcgtht:clousure.analys.log" required="yes"/>
  105. <xsl:param name="bcgtht:clousure.len" select="1"/>
  106. <xsl:param name="bcgtht:clousure.from"/>
  107. <xsl:param name="bcgtht:clousure.node" />
  108. <xsl:message> #120 bcgtht:clousure.analys.a @bcgtht:id=<xsl:value-of select="@bcgtht:id"/> $bcgtht:clousure.from=<xsl:value-of select="$bcgtht:clousure.from"/> ; $bcgtht:clousure.node=<xsl:value-of select="$bcgtht:clousure.node"/>; </xsl:message>
  109. <bcgtht:closure par="{$id}" chld="{@bcgtht:id}" len="{@bcgtht:clousure.from.len}" bcgtht:clousure.node="{$bcgtht:clousure.node}" bcgtht:clousure.from="{$bcgtht:clousure.from}" bcgtht:clousure.len="{$bcgtht:clousure.len}" debug="#136">
  110. <!--<xsl:attribute name="DEBUG122">#122 count key('bcgtht:clousure.node.from <xsl:value-of select="count(key('bcgtht:clousure.node.from',@bcgtht:clousure.node or @bcgtht:clousure.from )[ not(@bcgtht:id = current()/@bcgtht:id) and not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) ])"/></xsl:attribute>-->
  111. <xsl:attribute name="DEBUG122_N">#122 count key('bcgtht:clousure.node <xsl:value-of select="count(key('bcgtht:clousure.node',@bcgtht:clousure.node )[ not(@bcgtht:id = current()/@bcgtht:id) and not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) ])"/></xsl:attribute>
  112. <xsl:attribute name="DEBUG122_F">#122 count key('bcgtht:clousure.from <xsl:value-of select="count(key('bcgtht:clousure.from', @bcgtht:clousure.from )[ not(@bcgtht:id = current()/@bcgtht:id) and not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) ])"/></xsl:attribute>
  113. <!--<xsl:attribute name="DEBUG122_2">#123 count no filter key('bcgtht:clousure.node.from <xsl:value-of select="count(key('bcgtht:clousure.node.from',@bcgtht:clousure.node or @bcgtht:clousure.from )[ @bcgtht:id = current()/@bcgtht:id ])"/></xsl:attribute>-->
  114. <!--<xsl:attribute name="DEBUG122_3">#124 $bcgtht:id=<xsl:value-of select="$bcgtht:id"/> ; $bcgtht:clousure.from=<xsl:value-of select="$bcgtht:clousure.from"/> ; <xsl:value-of select="$bcgtht:clousure.node"/> ; </xsl:attribute>-->
  115. <xsl:choose>
  116. <!-- ten modul odwraca konce, kolejny respektuje wywolanie wprost -->
  117. <xsl:when test="$bcgtht:clousure.from">
  118. <xsl:apply-templates mode="bcgtht:clousure.analys.a" select="key('bcgtht:clousure.from', @bcgtht:clousure.from )[ not(@bcgtht:id = current()/@bcgtht:id) and not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) ]"> <!-- and not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) -->
  119. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  120. <!--<xsl:with-param name="bcgtht:clousure.from"/>-->
  121. <xsl:with-param name="bcgtht:clousure.from" select="@bcgtht:clousure.from"/>
  122. <xsl:with-param name="bcgtht:clousure.analys.log" select="$bcgtht:clousure.analys.log"/>
  123. <xsl:with-param name="bcgtht:clousure.len" select="$bcgtht:clousure.len + 1"/>
  124. </xsl:apply-templates>
  125. </xsl:when>
  126. <xsl:when test="$bcgtht:clousure.node">
  127. <xsl:apply-templates mode="bcgtht:clousure.analys.a" select="key('bcgtht:clousure.node',@bcgtht:clousure.node )[ not(@bcgtht:id = current()/@bcgtht:id) and not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) ]"> <!-- and not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) -->
  128. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  129. <!--<xsl:with-param name="bcgtht:clousure.from"/>-->
  130. <xsl:with-param name="bcgtht:clousure.node" select="@bcgtht:clousure.node"/>
  131. <xsl:with-param name="bcgtht:clousure.analys.log" select="$bcgtht:clousure.analys.log"/>
  132. <xsl:with-param name="bcgtht:clousure.len" select="$bcgtht:clousure.len + 1"/>
  133. </xsl:apply-templates>
  134. </xsl:when>
  135. <xsl:otherwise><xsl:message terminate="yes">#180 error for $id = <xsl:value-of select="$id"/></xsl:message></xsl:otherwise>
  136. </xsl:choose>
  137. </bcgtht:closure>
  138. </xsl:template>
  139. <xsl:function name="bcgtht:clousure.analys.log">
  140. <bcgtht:clousure.analys.log>
  141. <bcgtht:id/>
  142. </bcgtht:clousure.analys.log>
  143. </xsl:function>
  144. <xsl:function name="bcgtht:clousure.analys.log">
  145. <xsl:param name="bcgtht:id"/>
  146. <xsl:param name="bcgtht:clousure.analys.log"/>
  147. <xsl:choose>
  148. <xsl:when test="$bcgtht:clousure.analys.log//*[@bcgtht:id]"/>
  149. <xsl:otherwise>
  150. <bcgtht:clousure.analys.log>
  151. <xsl:for-each select="$bcgtht:clousure.analys.log//bcgtht:id">
  152. <xsl:copy-of select="."/>
  153. </xsl:for-each>
  154. <bcgtht:id xml:id="{$bcgtht:id}"/>
  155. </bcgtht:clousure.analys.log>
  156. </xsl:otherwise>
  157. </xsl:choose>
  158. </xsl:function>
  159. <xsl:function name="bcgtht:clousure.analys.log.loop-check">
  160. <xsl:param name="bcgtht:id"/>
  161. <xsl:param name="bcgtht:clousure.analys.log"/>
  162. <xsl:choose>
  163. <xsl:when test="$bcgtht:clousure.analys.log//*[@bcgtht:id = $bcgtht:id]">
  164. <xsl:message>#167 bcgtht:clousure.analys.log.loop-check for <xsl:value-of select="$bcgtht:id"/></xsl:message>
  165. </xsl:when>
  166. <xsl:otherwise><xsl:value-of select="true()"/></xsl:otherwise>
  167. </xsl:choose>
  168. </xsl:function>
  169. <xsl:template mode="bcgtht:clousure.analys.a" match="path.clousure.following|path.included">
  170. <!-- doczepienie zaleznosci wszelkich -->
  171. <xsl:param name="bcgtht:id"/>
  172. <xsl:param name="bcgtht:clousure.from"/>
  173. <xsl:param name="bcgtht:clousure.node"/>
  174. <xsl:param name="bcgtht:clousure.analys.log" select="bcgtht:clousure.analys.log()"/>
  175. <xsl:param name="bcgtht:clousure.len" select="1"/>
  176. <xsl:variable name="bcgtht:clousure.analys.log" select="bcgtht:clousure.analys.log(@bcgtht:id,$bcgtht:clousure.analys.log)"/>
  177. <xsl:choose>
  178. <xsl:when test="$bcgtht:clousure.analys.log/*">
  179. <!-- jak wchodzi na bcgtht:clousure.from, to wychodzi potem na bcgtht:clousure.node-->
  180. <xsl:message>#143 bcgtht:id=<xsl:value-of select="$bcgtht:id"/>.log.count = <xsl:value-of select="count($bcgtht:clousure.analys.log//*)"/></xsl:message>
  181. <bcgtht:a>
  182. <xsl:copy-of select="@bcgtht:id"/>
  183. <xsl:copy-of select="bcgtht:clousure.analys.debug.child.attr(@bcgtht:clousure.node)"/>
  184. <xsl:copy-of select="bcgtht:clousure.analys.debug.child.attr(@bcgtht:clousure.from)"/>
  185. <xsl:attribute name="bcgtht:l" select="$bcgtht:clousure.len"/>
  186. <xsl:attribute name="debug">191 bcgtht:clousure.analys.closure $bcgtht:clousure.from=<xsl:value-of select="$bcgtht:clousure.from"/> ; $bcgtht:clousure.node=<xsl:value-of select="$bcgtht:clousure.node"/> </xsl:attribute>
  187. <xsl:choose>
  188. <xsl:when test="$bcgtht:clousure.len &gt; 6">
  189. <xsl:message>bcgtht:clousure.len hit <xsl:value-of select="$bcgtht:clousure.len"/></xsl:message>
  190. </xsl:when>
  191. <xsl:when test="$bcgtht:clousure.node">
  192. <xsl:message>#201 bcgtht:clousure.analys.closure applyng for $bcgtht:clousure.node = <xsl:value-of select="$bcgtht:clousure.node"/></xsl:message>
  193. <xsl:apply-templates mode="bcgtht:clousure.analys.a" select="key('bcgtht:clousure.node.from',@bcgtht:clousure.node or @bcgtht:clousure.from )[ not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) ]">
  194. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  195. <!--<xsl:with-param name="bcgtht:clousure.from"/>-->
  196. <xsl:with-param name="bcgtht:clousure.node" select="@bcgtht:clousure.from"/>
  197. <xsl:with-param name="bcgtht:clousure.analys.log" select="$bcgtht:clousure.analys.log"/>
  198. <xsl:with-param name="bcgtht:clousure.len" select="$bcgtht:clousure.len + 1"/>
  199. </xsl:apply-templates>
  200. </xsl:when>
  201. <xsl:when test="$bcgtht:clousure.from">
  202. <xsl:message>#201 bcgtht:clousure.analys.closure applyng for $bcgtht:clousure.from = <xsl:value-of select="$bcgtht:clousure.from"/></xsl:message>
  203. <xsl:apply-templates mode="bcgtht:clousure.analys.a" select="key('bcgtht:clousure.node.from',@bcgtht:clousure.node or @bcgtht:clousure.from )[ not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) ]">
  204. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  205. <!--<xsl:with-param name="bcgtht:clousure.from"/>-->
  206. <xsl:with-param name="bcgtht:clousure.node" select="@bcgtht:clousure.node"/>
  207. <xsl:with-param name="bcgtht:clousure.analys.log" select="$bcgtht:clousure.analys.log"/>
  208. <xsl:with-param name="bcgtht:clousure.len" select="$bcgtht:clousure.len + 1"/>
  209. </xsl:apply-templates>
  210. </xsl:when>
  211. <xsl:when test="$bcgtht:id or @bcgtht:id">
  212. <xsl:message>#201 bcgtht:clousure.analys.closure applyng for both $by not $bcgtht:id <xsl:value-of select="@bcgtht:id"/></xsl:message>
  213. <xsl:comment>#216 bcgtht:clousure.analys.closure test="$bcgtht:id or @bcgtht:id"</xsl:comment>
  214. <xsl:apply-templates mode="bcgtht:clousure.analys.a" select="key('bcgtht:clousure.node.from',@bcgtht:clousure.node or @bcgtht:clousure.from )[ not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) ]">
  215. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  216. <!--<xsl:with-param name="bcgtht:clousure.from"/>-->
  217. <xsl:with-param name="bcgtht:clousure.node" select="@bcgtht:clousure.node"/>
  218. <xsl:with-param name="bcgtht:clousure.analys.log" select="$bcgtht:clousure.analys.log"/>
  219. <xsl:with-param name="bcgtht:clousure.len" select="$bcgtht:clousure.len + 1"/>
  220. </xsl:apply-templates>
  221. <xsl:apply-templates mode="bcgtht:clousure.analys.a" select="key('bcgtht:clousure.node.from',@bcgtht:clousure.node or @bcgtht:clousure.from )[ not(bcgtht:clousure.analys.log.loop-check(@bcgtht:id,$bcgtht:clousure.analys.log)) ]">
  222. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  223. <!--<xsl:with-param name="bcgtht:clousure.from"/>-->
  224. <xsl:with-param name="bcgtht:clousure.from" select="@bcgtht:clousure.from"/>
  225. <xsl:with-param name="bcgtht:clousure.analys.log" select="$bcgtht:clousure.analys.log"/>
  226. <xsl:with-param name="bcgtht:clousure.len" select="$bcgtht:clousure.len + 1"/>
  227. </xsl:apply-templates>
  228. </xsl:when>
  229. </xsl:choose>
  230. </bcgtht:a>
  231. </xsl:when>
  232. <xsl:otherwise>
  233. <xsl:comment>#159 bcgtht:clousure.analys.closure L:at:<xsl:value-of select="@bcgtht:id"/> $bcgtht:l=<xsl:value-of select="$bcgtht:clousure.len"/></xsl:comment>
  234. <xsl:message>#159 bcgtht:clousure.analys.closure L:at:<xsl:value-of select="@bcgtht:id"/> $bcgtht:l=<xsl:value-of select="$bcgtht:clousure.len"/></xsl:message>
  235. </xsl:otherwise>
  236. </xsl:choose>
  237. </xsl:template>
  238. <xsl:template mode="bcgtht:clousure.analys" match="path.included[number(@bcgtht:clousure.from.len) &lt;= $bcgtht.clousure.len_max or @bcgtht:clousure.node.pos = '0']">
  239. <xsl:element name="path.clousure.following">
  240. <xsl:copy-of select="@*"/>
  241. <xsl:copy-of select="bcgtht:clousure.analys.debug.child.attr(@bcgtht:clousure.node)"/>
  242. <xsl:copy-of select="bcgtht:clousure.analys.debug.child.attr(@bcgtht:clousure.from)"/>
  243. <!--SSS<xsl:apply-templates mode="p5yed:node.attr" select="."/>-->
  244. <xsl:apply-templates mode="bcgtht:clousure.analys.clousure.node.unique.descriptor.neigh" select="." >
  245. <xsl:with-param name="id" select="@bcgtht:id"/>
  246. </xsl:apply-templates>
  247. <!--<xsl:apply-templates mode="bcgtht:clousure.analys" select="following-sibling::path.included[ ( @bcgtht:clousure.from = current()/@bcgtht:clousure.from or @bcgtht:clousure.node = current()/@bcgtht:clousure.node ) and not(@bcgtht:id = current()/@bcgtht:id)][1]">
  248. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  249. <xsl:with-param name="bcgtht:clousure.from" select="@bcgtht:clousure.from"/>
  250. </xsl:apply-templates>-->
  251. <xsl:comment>#100 up from/dwn node</xsl:comment>
  252. <xsl:message>#100 up from/dwn node</xsl:message>
  253. <!--<xsl:apply-templates mode="bcgtht:clousure.analys" select="preceding-sibling::path.included[ ( @bcgtht:clousure.from = current()/@bcgtht:clousure.from or @bcgtht:clousure.node = current()/@bcgtht:clousure.node ) and not(@bcgtht:id = current()/@bcgtht:id)][1]">
  254. <xsl:with-param name="bcgtht:id" select="@bcgtht:id"/>
  255. <xsl:with-param name="bcgtht:clousure.node" select="@bcgtht:clousure.node"/>
  256. </xsl:apply-templates>-->
  257. </xsl:element>
  258. </xsl:template>
  259. <xsl:template mode="bcgtht:clousure.analys.closure bcgtht:clousure.analys" match="*"/>
  260. <xsl:template mode="bcgtht:clousure.analys.closure bcgtht:clousure.analys" match="path|text()|comment()"/>
  261. <xsl:template mode="bcgtht:clousure.analys.a bcgtht:clousure.analys.clousure.node.unique.descriptor.neigh" match="text()|comment()"/>
  262. <xsl:template mode="bcgtht:clousure.analys.a bcgtht:clousure.analys.clousure.node.unique.descriptor.neigh" match="*">
  263. <xsl:param name="id" required="yes"/>
  264. <!--<xsl:param name="bcgtht:clousure.from" required="yes"/>-->
  265. <!--<xsl:param name="bcgtht:clousure.node" required="yes"/>-->
  266. <!--<xsl:param name="bcgtht:clousure" required="yes"/>-->
  267. <xsl:comment>#99 matched <xsl:value-of select="name()"/>; </xsl:comment>
  268. <!--<xsl:variable name="bcgtht:edge.root">
  269. <bcgtht:edge.root>-->
  270. <xsl:for-each-group select="*/bcgtht:clousure.node.unique.descriptor/*[ @bcgtht:clousure.node.unique.descriptor.group ]" group-by="concat(parent::*/@bcgtht:edge.node,':',@bcgtht:clousure.node.unique.descriptor.group.oper.arg)"> <!-- @bcgtht:clousure.node.unique.descriptor.group.oper.arg -->
  271. <xsl:sort select="local-name()"/>
  272. <bcgtht:edge>
  273. <xsl:attribute name="bcgtht:id" select="$id"/>
  274. <xsl:attribute name="bcgtht:edge.group" select="parent::*/@bcgtht:edge.node"/>
  275. <!--<xsl:attribute name="bcgtht:edge.node" select="current-group()/parent::bcgtht:clousure.node.unique.descriptor/@bcgtht:edge.node"/>-->
  276. <!-- <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg.eval" select="current-grouping-key()"/>-->
  277. <xsl:for-each-group select="current-group()" group-by="local-name()">
  278. <xsl:attribute name="bcgtht:id.edge" >
  279. <xsl:value-of select="@bcgtht:clousure.node.unique.descriptor.group"/><xsl:value-of select="'|'"/>
  280. <xsl:for-each select="current-group()"><xsl:value-of select="."/>|</xsl:for-each>
  281. </xsl:attribute>
  282. </xsl:for-each-group>
  283. </bcgtht:edge>
  284. </xsl:for-each-group>
  285. <xsl:for-each-group select="*/bcgtht:clousure.node.unique.descriptor/*[ @bcgtht:clousure.node.unique.descriptor.group ]" group-by="@bcgtht:clousure.node.unique.descriptor.group.oper.arg"> <!-- @bcgtht:clousure.node.unique.descriptor.group.oper.arg -->
  286. <xsl:sort select="local-name()"/>
  287. <xsl:for-each-group select="." group-by="local-name()">
  288. <bcgtht:edge>
  289. <xsl:attribute name="bcgtht:id" select="$id"/>
  290. <!--<xsl:attribute name="bcgtht:edge.group" select="current-grouping-key()"/>-->
  291. <!--<xsl:attribute name="bcgtht:edge.node" select="current-group()/parent::bcgtht:clousure.node.unique.descriptor/@bcgtht:edge.node"/>-->
  292. <!-- <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg.eval" select="current-grouping-key()"/>-->
  293. <xsl:for-each-group select="current-group()" group-by="local-name()">
  294. <xsl:attribute name="bcgtht:id.edge" >
  295. <xsl:value-of select="@bcgtht:clousure.node.unique.descriptor.group"/><xsl:value-of select="'|'"/>
  296. <xsl:for-each select="current-group()"><xsl:value-of select="."/>|</xsl:for-each>
  297. </xsl:attribute>
  298. </xsl:for-each-group>
  299. </bcgtht:edge>
  300. </xsl:for-each-group>
  301. </xsl:for-each-group>
  302. <!--</bcgtht:edge.root>
  303. </xsl:variable>-->
  304. <!--<xsl:variable name="bcgtht:clousure.node.unique.descriptor" select="."/>-->
  305. <!--<xsl:for-each select="$bcgtht:edge.root/bcgtht:edge.root/*">
  306. <xsl:variable name="bcgtht:edge.root.current" select="."/>
  307. <xsl:element name="{name()}">
  308. <xsl:copy-of select="@*"/>
  309. <xsl:for-each-group select="$bcgtht:clousure.node.unique.descriptor/*/bcgtht:clousure.node.unique.descriptor" group-by="@bcgtht:edge.node">
  310. <xsl:variable name="bcgtht:id.edge.test">
  311. <xsl:for-each-group select="current-group()/*[@bcgtht:clousure.node.unique.descriptor.group]" group-by="@bcgtht:clousure.node.unique.descriptor.group">
  312. <xsl:value-of select="@bcgtht:clousure.node.unique.descriptor.group"/><xsl:value-of select="'|'"/>
  313. <xsl:for-each select="current-group()"><xsl:value-of select="."/>|</xsl:for-each>
  314. </xsl:for-each-group>
  315. </xsl:variable>
  316. <xsl:attribute name="debug_test{position()}" select="$bcgtht:id.edge.test"/>
  317. <xsl:if test="$bcgtht:id.edge.test = $bcgtht:edge.root.current/@bcgtht:id.edge">
  318. <xsl:attribute name="bcgtht:edge.node" select="@bcgtht:edge.node"/>
  319. </xsl:if>
  320. </xsl:for-each-group>
  321. </xsl:element>
  322. </xsl:for-each>-->
  323. </xsl:template>
  324. <xsl:template mode="bcgtht:clousure.analys.debug" match="*">
  325. <bcgtht:clousure.analys.debug>
  326. <xsl:apply-templates mode="bcgtht:clousure.analys.debug.child"/>
  327. </bcgtht:clousure.analys.debug>
  328. </xsl:template>
  329. <xsl:template mode="bcgtht:clousure.analys.debug.child" match="*">
  330. <xsl:apply-templates mode="#current"/>
  331. </xsl:template>
  332. <xsl:function name="bcgtht:clousure.analys.debug.child">
  333. <xsl:param name="node"/>
  334. <xsl:choose>
  335. <xsl:when test="contains($bcgtht:debug.nodes,$node)"> debug cust node<xsl:value-of select="$node"/></xsl:when>
  336. <xsl:when test="$node='BI_audit_KRS.161323'"><xsl:value-of select="'DEBUG_BI_audit_KRS.161323'"/></xsl:when>
  337. <xsl:when test="$node='BI_audit_KRS_person.747001'"><xsl:value-of select="'DEBUG_BI_audit_KRS_person.747001'"/></xsl:when>
  338. </xsl:choose>
  339. </xsl:function>
  340. <xsl:function name="bcgtht:clousure.analys.debug.child.attr">
  341. <xsl:param name="node"/>
  342. <xsl:choose>
  343. <xsl:when test="bcgtht:clousure.analys.debug.child($node)">
  344. <xsl:attribute name="DEBUG" select="bcgtht:clousure.analys.debug.child($node)"/>
  345. </xsl:when>
  346. </xsl:choose>
  347. </xsl:function>
  348. <xsl:template mode="bcgtht:clousure.analys.debug.child" match="*[bcgtht:clousure.analys.debug.child(@node)]">
  349. <xsl:copy copy-namespaces="no">
  350. <xsl:copy-of select="@*"/>
  351. <xsl:copy-of select="bcgtht:clousure.analys.debug.child.attr(@node)"/>
  352. <xsl:comment> #84 DEBUG <xsl:value-of select="bcgtht:clousure.analys.debug.child(@node)"/></xsl:comment>
  353. <xsl:copy-of select="."/>
  354. </xsl:copy>
  355. </xsl:template>
  356. <xsl:template mode="bcgtht:clousure.analys.debug.child" match="*[*[bcgtht:clousure.analys.debug.child(@node)]]">
  357. <xsl:copy copy-namespaces="no">
  358. <xsl:copy-of select="@*"/>
  359. <xsl:comment> #92 DEBUG <xsl:value-of select="bcgtht:clousure.analys.debug.child(*/@node)"/> </xsl:comment>
  360. <xsl:copy-of select="."/>
  361. <!--<xsl:apply-templates mode="#current"/>-->
  362. </xsl:copy>
  363. </xsl:template>
  364. <xsl:template mode="bcgtht:clousure.analys.debug.child" match="*[*[*[bcgtht:clousure.analys.debug.child(@node)]]]">
  365. <xsl:copy copy-namespaces="no">
  366. <xsl:copy-of select="@*"/>
  367. <xsl:comment> #101 DEBUG </xsl:comment>
  368. <xsl:apply-templates mode="#current"/>
  369. </xsl:copy>
  370. </xsl:template>
  371. <xsl:template mode="bcgtht:clousure.analys.debug.child" match="text()|comment()"/>
  372. </xsl:stylesheet>