bcgtht.tree_to_dita.applying_analys.xsl 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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:template name="bcgtht:applying_analys" >
  31. <xsl:param name="bcgtht:src_fid_analys" required="yes"/>
  32. <applying_analys>
  33. <xsl:for-each select="$bcgtht:src_fid_analys/src_fid_analys/src_fid">
  34. <xsl:copy copy-namespaces="no">
  35. <xsl:copy-of select="@*"/>
  36. <!--<gml:featureMember>-->
  37. <xsl:variable name="dst_fid.following.count" select="count(dst_fid[following-sibling])"/>
  38. <xsl:variable name="dst_fid.not.following.count" select="count(dst_fid[not(following-sibling)])"/>
  39. <xsl:variable name="src_fid" select="."/>
  40. <xsl:attribute name="dst_fid.following.count" select="$dst_fid.following.count"/>
  41. <xsl:attribute name="dst_fid.not.following.count" select="$dst_fid.not.following.count"/>
  42. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.from_analys" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row"/>
  43. <!--<xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[1]">
  44. <xsl:copy copy-namespaces="no">
  45. <xsl:copy-of select="@*"/>
  46. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.names"/>
  47. <xsl:for-each select="parent::*">
  48. <xsl:copy copy-namespaces="no">
  49. <xsl:copy-of select="@*"/>
  50. <xsl:for-each select="parent::*">
  51. <xsl:copy copy-namespaces="no">
  52. <xsl:copy-of select="@*"/>
  53. </xsl:copy>
  54. </xsl:for-each>
  55. </xsl:copy>
  56. </xsl:for-each>
  57. </xsl:copy>
  58. </xsl:for-each>-->
  59. <!--<xsl:for-each select="1 to $dst_fid.not.following.count">-->
  60. <!--<xsl:call-template name="bocian-graph-2-html.applying_analys">
  61. <xsl:with-param name="src_fid_analys" select="$bcgtht:src_fid_analys"/>
  62. <xsl:with-param name="dst_fid.not.following.count" select="$dst_fid.not.following.count"/>
  63. <xsl:with-param name="dst_fid.following.count" select="$dst_fid.following.count"/>
  64. <xsl:with-param name="src_fid" select="$src_fid"/>
  65. </xsl:call-template>-->
  66. <!--</xsl:for-each>-->
  67. <xsl:for-each select="dst_fid"> <!-- [not(following-sibling)] -->
  68. <xsl:sort select="count(following-sibling)" order="ascending"/>
  69. <!--<dst_fid_not_following-sibling>-->
  70. <xsl:copy copy-namespaces="no">
  71. <xsl:copy-of select="@*"/>
  72. <xsl:copy-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row" copy-namespaces="no"/>
  73. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.from_analys" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"/>
  74. <!--<TO_GRAPH>-->
  75. <xsl:for-each select="*[@key]">
  76. <xsl:sort select="position()" order="descending"/>
  77. <xsl:copy copy-namespaces="no">
  78. <xsl:copy-of select="@*"/>
  79. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.from_analys" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"/>
  80. <xsl:copy-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row" copy-namespaces="no"/>
  81. </xsl:copy>
  82. </xsl:for-each>
  83. <!--</TO_GRAPH>-->
  84. </xsl:copy>
  85. <!--</dst_fid_not_following-sibling>-->
  86. </xsl:for-each>
  87. <!--</gml:featureMember>-->
  88. </xsl:copy>
  89. </xsl:for-each>
  90. </applying_analys>
  91. </xsl:template>
  92. <xsl:template mode="bcgtht:applying_analys" match="applying_analys|TO_GRAPH">
  93. <xsl:apply-templates mode="#current"/>
  94. </xsl:template>
  95. <xsl:template mode="bcgtht:applying_analys" match="src_fid">
  96. <xsl:apply-templates mode="#current">
  97. <xsl:with-param name="src_fid.key" select="@key"/>
  98. </xsl:apply-templates>
  99. </xsl:template>
  100. <xsl:template mode="bcgtht:applying_analys" match="dst_fid">
  101. <xsl:param name="src_fid.key" required="yes"/>
  102. <gml:featureMember>
  103. <xsl:variable name="applying_analys.current" select="."/>
  104. <xsl:comment>
  105. #263 dst_fid called from($src_fid.keysrc_fid.key=<xsl:value-of select="$src_fid.key"/>) for <xsl:copy-of select="@*"/> must go as second after src; ancestor-or-self::src_fid/@key = <xsl:value-of select="ancestor-or-self::src_fid/@key"/> ; count var <xsl:value-of select="count(ancestor-or-self::src_fid/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object)"/> </xsl:comment>
  106. <xsl:for-each select="ancestor-or-self::src_fid/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  107. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  108. <!-- <xsl:copy copy-namespaces="no">-->
  109. <xsl:copy-of select="@*"/>
  110. <!--<xsl:comment>#124 current node <xsl:value-of select="name()"/>; *[1]/@fid<xsl:value-of select="*[1]/@fid"/></xsl:comment>-->
  111. <xsl:for-each select="*">
  112. <xsl:copy-of select="@*"/>
  113. <xsl:copy-of select="*" copy-namespaces="no"/>
  114. <xsl:comment>
  115. #128 src comes first upper</xsl:comment>
  116. <xsl:comment> last preceding-sibling is correct for row-object count prec sib last <xsl:value-of select="count($applying_analys.current/preceding-sibling[last()]/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object)"/></xsl:comment>
  117. <xsl:for-each select="$applying_analys.current/preceding-sibling[last()]/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  118. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  119. <xsl:copy-of select="@*"/>
  120. <xsl:comment>dst comes first next</xsl:comment>
  121. <xsl:for-each select="$applying_analys.current/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row">
  122. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  123. <!--<xsl:copy copy-namespaces="no">-->
  124. <xsl:copy-of select="@*"/>
  125. <xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  126. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  127. <xsl:copy-of select="@*"/>
  128. <xsl:for-each select="*">
  129. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  130. <!--<xsl:copy copy-namespaces="no">-->
  131. <xsl:copy-of select="@*"/>
  132. <xsl:copy-of select="*" copy-namespaces="no"/>
  133. </xsl:element>
  134. </xsl:for-each>
  135. </xsl:element>
  136. </xsl:for-each>
  137. <xsl:apply-templates mode="#current" select="$applying_analys.current/*">
  138. <xsl:with-param name="src_fid.key" select="'xx'"/>
  139. </xsl:apply-templates>
  140. <!--</xsl:copy>-->
  141. </xsl:element>
  142. </xsl:for-each>
  143. </xsl:element>
  144. </xsl:for-each>
  145. </xsl:for-each>
  146. <!--</xsl:copy>-->
  147. </xsl:element>
  148. </xsl:for-each>
  149. <!--<DEBUG_dst_fid>
  150. <xsl:copy-of select="."/>
  151. </DEBUG_dst_fid>-->
  152. <!--<xsl:apply-templates mode="#current" />-->
  153. </gml:featureMember>
  154. </xsl:template>
  155. <!--<xsl:template mode="bcgtht:applying_analys" match="dst_fid">
  156. <xsl:param name="src_fid.key" required="yes"/>
  157. <gml:featureMember>
  158. <xsl:variable name="applying_analys.current" select="."/>
  159. <xsl:comment>
  160. #263 dst_fid for <xsl:copy-of select="@*"/> must go as second after src; ancestor-or-self::src_fid/@key = <xsl:value-of select="ancestor-or-self::src_fid/@key"/> </xsl:comment>
  161. <!-\-<xsl:for-each select="ancestor-or-self::src_fid/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">-\->
  162. <!-\-<xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">-\->
  163. <!-\- <xsl:copy copy-namespaces="no">-\->
  164. <!-\-<xsl:copy-of select="@*"/>-\->
  165. <!-\-<xsl:for-each select="*">-\->
  166. <!-\-<xsl:copy-of select="@*"/>-\->
  167. <!-\-<xsl:copy-of select="*" copy-namespaces="no"/>-\->
  168. <!-\-<xsl:comment>src comes first upper</xsl:comment>-\->
  169. <xsl:comment> last preceding-sibling is correct for row-object</xsl:comment>
  170. <xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*"> <!-\- $applying_analys.current/preceding-sibling[last()]/ -\->
  171. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  172. <xsl:copy-of select="@*"/>
  173. <xsl:copy-of select="*" copy-namespaces="no"/>
  174. <xsl:for-each select="parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  175. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  176. <xsl:copy-of select="@*"/>
  177. <xsl:comment>dst comes first next</xsl:comment>
  178. <xsl:for-each select="parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row">
  179. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  180. <xsl:copy-of select="@*"/>
  181. <xsl:apply-templates mode="#current" select="$applying_analys.current/*">
  182. <xsl:with-param name="src_fid.key" select="'xx'"/>
  183. </xsl:apply-templates>
  184. <!-\-<xsl:for-each select="$applying_analys.current/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  185. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  186. <!-\\-<xsl:copy copy-namespaces="no">-\\->
  187. <xsl:copy-of select="@*"/>
  188. <xsl:for-each select="*">
  189. <!-\\-<xsl:copy copy-namespaces="no">-\\->
  190. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  191. <xsl:copy-of select="@*"/>
  192. <xsl:copy-of select="*" copy-namespaces="no"/>
  193. </xsl:element>
  194. <!-\\-</xsl:copy>-\\->
  195. </xsl:for-each>
  196. <!-\\-</xsl:copy>-\\->
  197. </xsl:element>
  198. <xsl:apply-templates mode="#current" select="$applying_analys.current/*">
  199. <xsl:with-param name="src_fid.key" select="'xx'"/>
  200. </xsl:apply-templates>
  201. </xsl:for-each>-\->
  202. </xsl:element>
  203. </xsl:for-each>
  204. </xsl:element>
  205. </xsl:for-each>
  206. </xsl:element>
  207. </xsl:for-each>
  208. <!-\-</xsl:for-each>-\->
  209. <!-\-</xsl:copy>-\->
  210. <!-\-</xsl:element>-\->
  211. <!-\-</xsl:for-each>-\->
  212. <!-\-<DEBUG_dst_fid>
  213. <xsl:copy-of select="."/>
  214. </DEBUG_dst_fid>-\->
  215. <!-\-<xsl:apply-templates mode="#current" />-\->
  216. </gml:featureMember>
  217. </xsl:template>-->
  218. <xsl:template mode="bcgtht:applying_analys" match="following-sibling">
  219. <xsl:comment>#315 following-sibling stop</xsl:comment>
  220. </xsl:template>
  221. <xsl:template mode="bcgtht:applying_analys" match="preceding-sibling">
  222. <xsl:param name="src_fid.key" required="yes"/>
  223. <xsl:variable name="applying_analys.current" select="."/>
  224. <xsl:comment>
  225. #89AAA preceding-sibling for <xsl:copy-of select="@*"/> count(preceding-sibling::*)=<xsl:value-of select="count(preceding-sibling::*)"/> , count(following-sibling::*)=<xsl:value-of select="count(following-sibling::*)"/></xsl:comment>
  226. <xsl:choose>
  227. <xsl:when test="$src_fid.key = @key">
  228. <xsl:comment>#347 when test="$src_fid.key = @key" </xsl:comment>
  229. </xsl:when>
  230. <xsl:when test="count(preceding-sibling::*) = 0">
  231. <xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*">
  232. <!-- <xsl:copy copy-namespaces="no">-->
  233. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  234. <xsl:copy-of select="@*"/>
  235. <xsl:copy-of select="*" copy-namespaces="no"/>
  236. <xsl:for-each select="parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  237. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  238. <!--<xsl:copy copy-namespaces="no">-->
  239. <xsl:copy-of select="@*"/>
  240. <xsl:copy-of select="*" copy-namespaces="no"/>
  241. <xsl:for-each select="parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row">
  242. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  243. <!--<xsl:copy copy-namespaces="no">-->
  244. <xsl:copy-of select="@*"/>
  245. <xsl:copy-of select="*" copy-namespaces="no"/>
  246. <!--<xsl:apply-templates mode="#current" select="$applying_analys.current/*"/>-->
  247. <!--</xsl:copy>-->
  248. </xsl:element>
  249. </xsl:for-each>
  250. <!--<xsl:apply-templates mode="#current" select="$applying_analys.current/*"/>-->
  251. <!--</xsl:copy>-->
  252. </xsl:element>
  253. </xsl:for-each>
  254. </xsl:element>
  255. <!--</xsl:copy>-->
  256. </xsl:for-each>
  257. </xsl:when>
  258. </xsl:choose>
  259. <xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  260. <!-- <xsl:copy copy-namespaces="no">-->
  261. <xsl:element name="{system_cache__dita:bocian.add.elements(local-name())}">
  262. <xsl:copy-of select="@*"/>
  263. <!--<xsl:copy-of select="*" copy-namespaces="no"/>-->
  264. <xsl:for-each select="*">
  265. <xsl:copy copy-namespaces="no">
  266. <xsl:copy-of select="@*"/>
  267. <xsl:copy-of select="*" copy-namespaces="no"/>
  268. <!--<xsl:apply-templates mode="#current" select="$applying_analys.current/*"/>-->
  269. </xsl:copy>
  270. </xsl:for-each>
  271. </xsl:element>
  272. <!--</xsl:copy>-->
  273. </xsl:for-each>
  274. <!--<DEBUGpreceding-sibling>
  275. <xsl:copy-of select="."/>
  276. </DEBUGpreceding-sibling>-->
  277. </xsl:template>
  278. </xsl:stylesheet>