bcgtht.tree_to_dita.clousure.xsl 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  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. exclude-result-prefixes="xs"
  27. version="2.0">
  28. <xsl:output indent="yes"/>
  29. <xsl:strip-space elements="*"/> <!-- -->
  30. <xsl:param name="bcgtht:path.included.disable" select="true()"/>
  31. <xsl:function name="bcgtht:clousure.from">
  32. <xsl:param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row"/>
  33. <xsl:param name="bcgtht:clousure.reverse"/>
  34. <xsl:choose>
  35. <xsl:when test="$bcgtht:clousure.reverse = 1">
  36. <xsl:value-of select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid"></xsl:value-of>
  37. </xsl:when>
  38. <xsl:otherwise>
  39. <xsl:value-of select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid"></xsl:value-of>
  40. </xsl:otherwise>
  41. </xsl:choose>
  42. </xsl:function>
  43. <xsl:function name="bcgtht:clousure.to">
  44. <xsl:param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row"/>
  45. <xsl:param name="bcgtht:clousure.reverse"/>
  46. <xsl:choose>
  47. <xsl:when test="$bcgtht:clousure.reverse = 1">
  48. <xsl:value-of select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid"/>
  49. </xsl:when>
  50. <xsl:otherwise>
  51. <xsl:value-of select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid"/>
  52. </xsl:otherwise>
  53. </xsl:choose>
  54. </xsl:function>
  55. <xsl:function name="bcgtht:clousure.len">
  56. <xsl:param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row"/>
  57. <xsl:value-of select="count($BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object)"/>
  58. </xsl:function>
  59. <xsl:function name="bcgtht:clousure.node">
  60. <xsl:param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"/>
  61. <xsl:value-of select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[1]/@fid"/>
  62. </xsl:function>
  63. <xsl:function name="bcgtht:clousure.node.name">
  64. <xsl:param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"/>
  65. <xsl:value-of select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[1]/local-name()"/>
  66. </xsl:function>
  67. <xsl:function name="bcgtht:clousure.node.name.from.fid">
  68. <xsl:param name="fid"/>
  69. <xsl:value-of select="substring-before($fid,'.')"/>
  70. </xsl:function>
  71. <xsl:function name="bcgtht:clousure.node.pos">
  72. <xsl:param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"/>
  73. <xsl:param name="bcgtht:clousure.reverse"/>
  74. <xsl:choose>
  75. <xsl:when test="$bcgtht:clousure.reverse = 1">
  76. <xsl:value-of select="count($BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/following-sibling::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object)"/>
  77. </xsl:when>
  78. <xsl:otherwise>
  79. <xsl:value-of select="count($BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/preceding-sibling::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object)"/>
  80. </xsl:otherwise>
  81. </xsl:choose>
  82. </xsl:function>
  83. <xsl:template mode="bcgtht:clousure" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA">
  84. <bcgtht:clousure>
  85. <xsl:copy-of select="@*"/>
  86. <xsl:apply-templates mode="#current"/>
  87. </bcgtht:clousure>
  88. </xsl:template>
  89. <xsl:template mode="bcgtht:clousure" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row">
  90. <xsl:comment>_row <xsl:copy-of select="@*"/></xsl:comment>
  91. <xsl:copy copy-namespaces="no">
  92. <xsl:copy-of select="@*"/>
  93. <xsl:apply-templates mode="#current">
  94. <xsl:with-param name="bcgtht:clousure.reverse" select="0"/>
  95. </xsl:apply-templates>
  96. <xsl:comment>#215 reverse</xsl:comment>
  97. <xsl:apply-templates mode="#current">
  98. <xsl:with-param name="bcgtht:clousure.reverse" select="1"/>
  99. <xsl:sort select="position()" data-type="number" order="descending"/>
  100. </xsl:apply-templates>
  101. </xsl:copy>
  102. </xsl:template>
  103. <xsl:template mode="bcgtht:clousure" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  104. <xsl:param name="bcgtht:clousure.reverse" required="yes"/>
  105. <xsl:variable name="bcgtht:clousure.from.len" select="bcgtht:clousure.len(parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row)"/>
  106. <path node="{bcgtht:clousure.node(.)}" pos="{bcgtht:clousure.node.pos(.,$bcgtht:clousure.reverse)}"
  107. from="{bcgtht:clousure.from(parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row,$bcgtht:clousure.reverse)}"
  108. path.to="{bcgtht:clousure.to(parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row,$bcgtht:clousure.reverse)}"
  109. bcgtht:clousure.from.len="{$bcgtht:clousure.from.len}"
  110. fid="{@fid}"
  111. >
  112. <xsl:attribute name="p5:primaryKey" select="p5:primaryKey(bcgtht:clousure.node(.))"/>
  113. <xsl:if test="$bcgtht:clousure.reverse = 1"><xsl:attribute name="bcgtht:clousure.reverse" select="$bcgtht:clousure.reverse"/></xsl:if>
  114. </path>
  115. <xsl:choose>
  116. <xsl:when test="$bcgtht:clousure.reverse = 1">
  117. <xsl:apply-templates mode="bcgtht:clousure.following" select="preceding-sibling::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  118. <xsl:with-param name="bcgtht:clousure.from" select="bcgtht:clousure.from(parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row,$bcgtht:clousure.reverse)"/>
  119. <xsl:with-param name="bcgtht:clousure.node.pos" select="bcgtht:clousure.node.pos(.,$bcgtht:clousure.reverse)"/>
  120. <xsl:with-param name="bcgtht:clousure.context" select="."/>
  121. <xsl:with-param name="bcgtht:clousure.from.node.name" select="bcgtht:clousure.node.name(.)"/>
  122. <xsl:with-param name="bcgtht:clousure.from.node.primaryKey" select="p5:primaryKey(bcgtht:clousure.node(.))"/>
  123. <xsl:with-param name="bcgtht:clousure.reverse" select="$bcgtht:clousure.reverse"/>
  124. <xsl:with-param name="bcgtht:clousure.from.len" select="$bcgtht:clousure.from.len"/>
  125. <xsl:sort select="position()" data-type="number" order="descending"/>
  126. </xsl:apply-templates>
  127. </xsl:when>
  128. <xsl:otherwise>
  129. <xsl:apply-templates mode="bcgtht:clousure.following" select="following-sibling::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  130. <xsl:with-param name="bcgtht:clousure.from" select="bcgtht:clousure.from(parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row,$bcgtht:clousure.reverse)"/>
  131. <xsl:with-param name="bcgtht:clousure.node.pos" select="bcgtht:clousure.node.pos(.,$bcgtht:clousure.reverse)"/>
  132. <xsl:with-param name="bcgtht:clousure.context" select="."/>
  133. <xsl:with-param name="bcgtht:clousure.from.node.name" select="bcgtht:clousure.node.name(.)"/>
  134. <xsl:with-param name="bcgtht:clousure.from.node.primaryKey" select="p5:primaryKey(bcgtht:clousure.node(.))"/>
  135. <xsl:with-param name="bcgtht:clousure.reverse" select="$bcgtht:clousure.reverse"/>
  136. <xsl:with-param name="bcgtht:clousure.from.len" select="$bcgtht:clousure.from.len"/>
  137. </xsl:apply-templates>
  138. </xsl:otherwise>
  139. </xsl:choose>
  140. </xsl:template>
  141. <xsl:function name="bcgtht:clousure.from.len">
  142. <xsl:param name="bcgtht:clousure.node.pos"/>
  143. <xsl:param name="bcgtht:clousure.node.pos.current"/>
  144. <xsl:param name="bcgtht:clousure.reverse"/>
  145. <xsl:choose>
  146. <xsl:when test="$bcgtht:clousure.reverse = 1">
  147. <xsl:value-of select="$bcgtht:clousure.node.pos.current - $bcgtht:clousure.node.pos"/>
  148. </xsl:when>
  149. <xsl:otherwise>
  150. <xsl:value-of select="$bcgtht:clousure.node.pos.current - $bcgtht:clousure.node.pos"/>
  151. </xsl:otherwise>
  152. </xsl:choose>
  153. </xsl:function>
  154. <xsl:template mode="bcgtht:clousure.following" match="*|text()|comment()"/>
  155. <xsl:template mode="bcgtht:clousure.following" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  156. <xsl:param name="bcgtht:clousure.from" required="yes"/>
  157. <xsl:param name="bcgtht:clousure.node.pos" required="yes"/>
  158. <xsl:param name="bcgtht:clousure.context" required="yes"/>
  159. <xsl:param name="bcgtht:clousure.from.node.name" required="yes"/>
  160. <xsl:param name="bcgtht:clousure.from.node.primaryKey" required="yes"/>
  161. <xsl:param name="bcgtht:clousure.reverse" required="yes"/>
  162. <xsl:variable name="bcgtht:clousure.from.len" select="bcgtht:clousure.from.len($bcgtht:clousure.node.pos,bcgtht:clousure.node.pos(.,$bcgtht:clousure.reverse),$bcgtht:clousure.reverse)"/>
  163. <path.clousure.following
  164. bcgtht:id="{generate-id()}"
  165. bcgtht:clousure.from.len="{$bcgtht:clousure.from.len}"
  166. bcgtht:clousure.from="{$bcgtht:clousure.from}"
  167. bcgtht:clousure.node.pos="{$bcgtht:clousure.node.pos}"
  168. to.node="{bcgtht:clousure.node(.)}"
  169. pos="{bcgtht:clousure.node.pos(.,$bcgtht:clousure.reverse)}"
  170. from="{bcgtht:clousure.from(parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row,$bcgtht:clousure.reverse)}"
  171. to="{bcgtht:clousure.to(parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row,$bcgtht:clousure.reverse)}"
  172. len="{bcgtht:clousure.len(parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row)}">
  173. <!--<xsl:attribute name="p5:primaryKey" select="p5:primaryKey(bcgtht:clousure.node(.))"/>-->
  174. <!--<xsl:attribute name="bcgtht:clousure.node.name" select="bcgtht:clousure.node.name(.)"/>-->
  175. <xsl:attribute name="bcgtht:clousure.node" select="bcgtht:clousure.node(.)"/>
  176. <!--<xsl:attribute name="bcgtht:clousure.from.node.name" select="$bcgtht:clousure.from.node.name"/>-->
  177. <!--<xsl:attribute name="bcgtht:clousure.from.node.primaryKey" select="$bcgtht:clousure.from.node.primaryKey"/>-->
  178. <xsl:if test="$bcgtht:clousure.reverse = 1">
  179. <xsl:attribute name="bcgtht:clousure.reverse" select="$bcgtht:clousure.reverse"/>
  180. <xsl:attribute name="bcgtht:clousure.node.pos_DEBUG_INV" select="bcgtht:clousure.node.pos(.,0)"/>
  181. <xsl:attribute name="bcgtht:clousure.node.pos_count_DEBUG_INV" select="count(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/preceding-sibling::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object)"/>
  182. <xsl:attribute name="bcgtht:clousure.node.pos_DEBUG_INV_pos" select="position()"/>
  183. </xsl:if>
  184. <xsl:copy-of select="bcgtht:clousure.node.unique.descriptor(.,'A')"/>
  185. <xsl:copy-of select="bcgtht:clousure.node.unique.descriptor($bcgtht:clousure.context,'B')"/>
  186. <!--case rev test<xsl:variable name="bcgtht:clousure.from" select="bcgtht:clousure.node(.)"/>-->
  187. <xsl:variable name="bcgtht:clousure.from.node.name" select="bcgtht:clousure.node.name(.)"/>
  188. <xsl:variable name="bcgtht:clousure.from.node.primaryKey" select="p5:primaryKey(bcgtht:clousure.node(.))"/>
  189. <xsl:choose>
  190. <xsl:when test="$bcgtht:path.included.disable"><xsl:comment>#220 $bcgtht:path.included.disable</xsl:comment></xsl:when>
  191. <xsl:when test="$bcgtht:clousure.reverse = 1">
  192. <xsl:variable name="bcgtht:clousure.from" select="bcgtht:clousure.node(.)"/>
  193. <xsl:for-each select="$bcgtht:clousure.context/preceding-sibling::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() &lt;= $bcgtht:clousure.from.len ]">
  194. <!--<xsl:sort select="position()" data-type="number" order="descending"/>-->
  195. <xsl:variable name="bcgtht:clousure.from.context" select="."/>
  196. <xsl:apply-templates mode="bcgtht:clousure.following.path.included" select=".">
  197. <xsl:with-param name="bcgtht:clousure.from" select="$bcgtht:clousure.from"/>
  198. <xsl:with-param name="bcgtht:clousure.from.context" select="$bcgtht:clousure.from.context"/>
  199. <xsl:with-param name="bcgtht:clousure.from.node.name" select="$bcgtht:clousure.from.node.name"/>
  200. <xsl:with-param name="bcgtht:clousure.from.node.primaryKey" select="$bcgtht:clousure.from.node.primaryKey"/>
  201. <xsl:with-param name="bcgtht:clousure.reverse" select="$bcgtht:clousure.reverse"/>
  202. <xsl:with-param name="bcgtht:clousure.from.len" select="$bcgtht:clousure.from.len"/>
  203. </xsl:apply-templates>
  204. </xsl:for-each>
  205. </xsl:when>
  206. <xsl:otherwise>
  207. <xsl:for-each select="$bcgtht:clousure.context/following-sibling::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() &lt;= $bcgtht:clousure.from.len ]">
  208. <xsl:variable name="bcgtht:clousure.from.context" select="."/>
  209. <xsl:apply-templates mode="bcgtht:clousure.following.path.included" select=".">
  210. <xsl:with-param name="bcgtht:clousure.from" select="$bcgtht:clousure.from"/>
  211. <xsl:with-param name="bcgtht:clousure.from.context" select="$bcgtht:clousure.from.context"/>
  212. <xsl:with-param name="bcgtht:clousure.from.node.name" select="$bcgtht:clousure.from.node.name"/>
  213. <xsl:with-param name="bcgtht:clousure.from.node.primaryKey" select="$bcgtht:clousure.from.node.primaryKey"/>
  214. <xsl:with-param name="bcgtht:clousure.reverse" select="$bcgtht:clousure.reverse"/>
  215. <xsl:with-param name="bcgtht:clousure.from.len" select="$bcgtht:clousure.from.len"/>
  216. </xsl:apply-templates>
  217. </xsl:for-each>
  218. </xsl:otherwise>
  219. </xsl:choose>
  220. </path.clousure.following>
  221. </xsl:template>
  222. <xsl:template mode="bcgtht:clousure.following.path.included" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  223. <xsl:param name="bcgtht:clousure.from" required="yes"/>
  224. <xsl:param name="bcgtht:clousure.from.context" required="yes"/>
  225. <xsl:param name="bcgtht:clousure.from.node.name" required="yes"/>
  226. <xsl:param name="bcgtht:clousure.from.node.primaryKey" required="yes"/>
  227. <xsl:param name="bcgtht:clousure.reverse" required="yes"/>
  228. <xsl:param name="bcgtht:clousure.from.len" required="yes"/>
  229. <path.included bcgtht:id="{generate-id()}"
  230. node="{bcgtht:clousure.node(.)}">
  231. <xsl:attribute name="bcgtht:clousure.from" select="$bcgtht:clousure.from"/>
  232. <!--<xsl:attribute name="bcgtht:clousure.from.node.name" select="$bcgtht:clousure.from.node.name"/>-->
  233. <!--<xsl:attribute name="bcgtht:clousure.from.node.primaryKey" select="$bcgtht:clousure.from.node.primaryKey"/>-->
  234. <!--<xsl:attribute name="p5:primaryKey" select="p5:primaryKey(bcgtht:clousure.node(.))"/>-->
  235. <xsl:attribute name="bcgtht:clousure.node" select="bcgtht:clousure.node(.)"/>
  236. <!--<xsl:attribute name="bcgtht:clousure.node.name" select="bcgtht:clousure.node.name(.)"/>-->
  237. <!--<xsl:attribute name="bcgtht:clousure.node.primaryKey" select="p5:primaryKey(bcgtht:clousure.node(.))"/>-->
  238. <!--<xsl:attribute name="bcgtht:clousure.from.node.name" select="$bcgtht:clousure.from.node.name"/>-->
  239. <!--<xsl:attribute name="bcgtht:clousure.from.node.primaryKey" select="$bcgtht:clousure.from.node.primaryKey"/>-->
  240. <xsl:choose>
  241. <xsl:when test="$bcgtht:clousure.reverse = 1">
  242. <xsl:attribute name="bcgtht:clousure.reverse" select="$bcgtht:clousure.reverse"/>
  243. <xsl:attribute name="bcgtht:clousure.node.pos_DEBUG_INV" select="bcgtht:clousure.node.pos(parent::*,0)"/>
  244. <xsl:attribute name="bcgtht:clousure.from.len_DEBUG_IN" select="$bcgtht:clousure.from.len"/>
  245. <xsl:attribute name="bcgtht:clousure.from.pos_DEBUG_IN" select="position()"/>
  246. <xsl:attribute name="bcgtht:clousure.from.len" select="position() + 1"/>
  247. </xsl:when>
  248. <xsl:otherwise>
  249. <xsl:attribute name="bcgtht:clousure.from.len" select="position()"/>
  250. </xsl:otherwise>
  251. </xsl:choose>
  252. <!-- nie ma potrzeby dodatkowego unique descriptora -->
  253. <!--<xsl:copy-of select="bcgtht:clousure.node.unique.descriptor(.,'A')"/>-->
  254. <!--<xsl:copy-of select="bcgtht:clousure.node.unique.descriptor($bcgtht:clousure.from.context,'B')"/>-->
  255. <!--<bcgtht:clousure.node.unique.descriptor>
  256. <xsl:apply-templates mode="bcgtht:clousure.node.unique.descriptor"/>
  257. </bcgtht:clousure.node.unique.descriptor>-->
  258. </path.included>
  259. </xsl:template>
  260. <xsl:template mode="bcgtht:clousure.following.path.included" match="text()|comment()"/>
  261. <xsl:template mode="bcgtht:clousure" match="*">
  262. <!--<xsl:message terminate="yes">#38 unantended mode mode="bcgtht:clousure" for element = <xsl:value-of select="name()"/>; </xsl:message>-->
  263. </xsl:template>
  264. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="krs[text()]">
  265. <xsl:copy copy-namespaces="no">
  266. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group" select="'company'"/>
  267. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg" select="'krs'"/>
  268. <xsl:copy-of select="text()"/>
  269. </xsl:copy>
  270. </xsl:template>
  271. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="nip[text()]">
  272. <xsl:copy copy-namespaces="no">
  273. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group" select="'company'"/>
  274. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg" select="'nip'"/>
  275. <xsl:copy-of select="text()"/>
  276. </xsl:copy>
  277. </xsl:template>
  278. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="regon[text()]">
  279. <xsl:copy copy-namespaces="no">
  280. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group" select="'company'"/>
  281. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg" select="'regon'"/>
  282. <xsl:copy-of select="text()"/>
  283. </xsl:copy>
  284. </xsl:template>
  285. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="pesel[text()]">
  286. <xsl:copy copy-namespaces="no">
  287. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group" select="'person'"/>
  288. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg" select="'pesel'"/>
  289. <xsl:copy-of select="text()"/>
  290. </xsl:copy>
  291. </xsl:template>
  292. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="nazwa[text()]">
  293. <xsl:copy copy-namespaces="no">
  294. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.not"/>
  295. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.text"/>
  296. <!--<xsl:copy-of select="text()"/>-->
  297. <xsl:for-each select="tokenize(text(),' ')">
  298. <xsl:choose>
  299. <xsl:when test="position()=1">
  300. <xsl:value-of select="."/>
  301. </xsl:when>
  302. </xsl:choose>
  303. </xsl:for-each>
  304. </xsl:copy>
  305. </xsl:template>
  306. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="nazwisko[text()]">
  307. <xsl:copy copy-namespaces="no">
  308. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.not"/>
  309. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.text"/>
  310. <xsl:copy-of select="text()"/>
  311. </xsl:copy>
  312. </xsl:template>
  313. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="A_nrDomu[text()]">
  314. <xsl:copy copy-namespaces="no">
  315. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group" select="'teryt'"/>
  316. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper" select="'and'"/>
  317. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg" select="'teryt'"/>
  318. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.text"/>
  319. <xsl:copy-of select="text()"/>
  320. </xsl:copy>
  321. </xsl:template>
  322. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="S_miejscowosc[text()]">
  323. <xsl:copy copy-namespaces="no">
  324. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.not"/>
  325. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.text"/>
  326. <xsl:copy-of select="text()"/>
  327. </xsl:copy>
  328. </xsl:template>
  329. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="A_ulica[text()]">
  330. <xsl:copy copy-namespaces="no">
  331. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.not"/>
  332. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.text"/>
  333. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg" select="'teryt'"/>
  334. <xsl:copy-of select="text()"/>
  335. </xsl:copy>
  336. </xsl:template>
  337. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="TERYT_SYM_UL[text()]">
  338. <xsl:copy copy-namespaces="no">
  339. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group" select="'teryt'"/>
  340. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper" select="'and'"/>
  341. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg" select="'teryt'"/>
  342. <xsl:copy-of select="text()"/>
  343. </xsl:copy>
  344. </xsl:template>
  345. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="TERYT_SYM[text()]">
  346. <xsl:copy copy-namespaces="no">
  347. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group" select="'teryt'"/>
  348. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper" select="'and'"/>
  349. <xsl:attribute name="bcgtht:clousure.node.unique.descriptor.group.oper.arg" select="'teryt'"/>
  350. <xsl:copy-of select="text()"/>
  351. </xsl:copy>
  352. </xsl:template>
  353. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="*">
  354. <xsl:apply-templates mode="#current"/>
  355. </xsl:template>
  356. <xsl:template mode="bcgtht:clousure.node.unique.descriptor" match="text()|comment()"/>
  357. <xsl:template name="bcgtht:clousure.node.unique.descriptor">
  358. <xsl:param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object" required="yes"/>
  359. <xsl:param name="bcgtht:edge.node" required="yes"/>
  360. <!--<xsl:variable name="bcgtht:clousure.node.unique.descriptor">-->
  361. <bcgtht:clousure.node.unique.descriptor bcgtht:edge.node="{$bcgtht:edge.node}">
  362. <xsl:for-each-group select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[1]//*" group-by="name()">
  363. <xsl:apply-templates mode="bcgtht:clousure.node.unique.descriptor" select=".">
  364. <xsl:sort select="local-name()"/>
  365. </xsl:apply-templates>
  366. </xsl:for-each-group>
  367. <!--<xsl:apply-templates mode="bcgtht:clousure.node.unique.descriptor" select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[1]">
  368. <xsl:sort select="local-name()"/>
  369. </xsl:apply-templates>-->
  370. </bcgtht:clousure.node.unique.descriptor>
  371. <!--</xsl:variable>-->
  372. </xsl:template>
  373. <xsl:function name="bcgtht:clousure.node.unique.descriptor">
  374. <xsl:param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"/>
  375. <xsl:param name="bcgtht:edge.node"/>
  376. <xsl:call-template name="bcgtht:clousure.node.unique.descriptor">
  377. <xsl:with-param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object" select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"/>
  378. <xsl:with-param name="bcgtht:edge.node" select="$bcgtht:edge.node"/>
  379. </xsl:call-template>
  380. </xsl:function>
  381. </xsl:stylesheet>