bcgtht.tree_to_dita.working.xsl 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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:yed="http://www.yworks.com/xml/yed/3"
  27. exclude-result-prefixes="xs"
  28. version="2.0">
  29. <xsl:import href="bcgtht.tree_to_dita.import.xsl"/>
  30. <xsl:output indent="yes"/>
  31. <xsl:strip-space elements="*"/> <!-- -->
  32. <xsl:include href="../p5/p5.primaryKey.xsl"/>
  33. <xsl:include href="bcgtht.tree_to_dita.src_fid_analys.xsl"/>
  34. <xsl:include href="bcgtht.tree_to_dita.applying_analys.xsl"/>
  35. <xsl:include href="bcgtht.tree_to_dita.clousure.xsl"/>
  36. <xsl:include href="bcgtht.tree_to_dita.clousure.analys.xsl"/>
  37. <xsl:include href="bcgtht.tree_to_dita.clousure.analys.merge.xsl"/>
  38. <xsl:include href="bcgtht.tree_to_dita.clousure.analys.merge.apply.xsl"/>
  39. <xsl:include href="bcgtht.tree_to_dita.clousure.analys.merge.apply.rename.xsl"/>
  40. <xsl:include href="bcgtht.tree_to_dita.clousure.analys.merge.apply.rename.analys.xsl"/>
  41. <xsl:include href="../yed/p5yed.yed.graphml.xsl"/>
  42. <xsl:param name="bcgtht:debug" select="4"/>
  43. <!-- to be used from tree_to_dita.xsl -->
  44. <xsl:template mode="bocian-graph-2-html.preprocess" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA|BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[@fid]">
  45. <xsl:variable name="fileindex" select="@fid"/>
  46. <xsl:result-document href="{$ditadir}/bocian-graph-2-html/{$fileindex}.xml" omit-xml-declaration="yes">
  47. <wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs" xmlns="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:default_db__x3A__BI_audit_ENERGA_PRACOWNICY="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_PRACOWNICY" xmlns:p5="https://biuro.biall-net.pl/wfs" 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" 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" xmlns:default_db__x3A__BI_audit_KRS="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS" xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI" xmlns:default_db__x3A__BI_audit_MSIG="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG" xmlns:default_db__x3A__BI_audit_CEIDG="https://biuro.biall-net.pl/wfs/default_db/BI_audit_CEIDG" xsi:schemaLocation="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_PRACOWNICY https://biuro.biall-net.pl/dev-pl/se-projects/bocian/SE//wfs-data.php/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;TYPENAME=default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY&amp;REQUEST=DescribeFeatureType" numberMatched="unknown" numberReturned="1" next="https://biuro.biall-net.pl/dev-pl/se-projects/bocian/SE//wfs-data.php/default_db/?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=default_db__x3A__BI_audit_ENERGA_PRACOWNICY%3ABI_audit_ENERGA_PRACOWNICY&amp;SRSNAME=EPSG%3A3003&amp;sortBy=ID+D&amp;maxFeatures=20&amp;startIndex=20">
  48. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.child" select="."/>
  49. <!-- strategy
  50. wszystkie wyjscia od pracownika
  51. row_object
  52. row
  53. row_object
  54. KONTR
  55. -->
  56. </wfs:FeatureCollection>
  57. </xsl:result-document>
  58. <bocian-graph-2-html xsl:exclude-result-prefixes="p5 bcgtht" xsl:xpath-default-namespace="" srcfile="{$ditadir}/bocian-graph-2-html/{$fileindex}.xml" dstfile="{$ditadir}/bocian-graph-2-html/{$fileindex}.png.xml" fileindex="{$fileindex}" ditadir="{$ditadir}" />
  59. </xsl:template>
  60. <xsl:template mode="bocian-graph-2-html.preprocess.child" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA">
  61. <!--<xsl:apply-templates mode="#current" select="*"/>--> <!-- [1] -->
  62. <xsl:variable name="bcgtht:src_fid_analys">
  63. <xsl:apply-templates mode="bcgtht:src_fid_analys" select="."/>
  64. </xsl:variable>
  65. <xsl:variable name="bcgtht:clousure">
  66. <xsl:apply-templates mode="bcgtht:clousure" select="."/>
  67. </xsl:variable>
  68. <xsl:variable name="bcgtht:clousure.analys">
  69. <xsl:call-template name="bcgtht:clousure.analys">
  70. <xsl:with-param name="bcgtht:clousure" select="$bcgtht:clousure"/>
  71. </xsl:call-template>
  72. </xsl:variable>
  73. <xsl:variable name="bcgtht:clousure.analys.merge">
  74. <xsl:apply-templates mode="bcgtht:clousure.analys.merge" select="$bcgtht:clousure.analys"/>
  75. </xsl:variable>
  76. <xsl:variable name="bcgtht:clousure.analys.merge.apply">
  77. <xsl:apply-templates mode="bcgtht:clousure.analys.merge.apply" select="$bcgtht:clousure.analys.merge"/>
  78. </xsl:variable>
  79. <xsl:variable name="bcgtht:clousure.analys.merge.apply.rename">
  80. <xsl:apply-templates mode="bcgtht:clousure.analys.merge.apply.rename" select="$bcgtht:clousure.analys.merge.apply"/>
  81. </xsl:variable>
  82. <xsl:variable name="bcgtht:clousure.analys.merge.apply.rename.analys">
  83. <xsl:apply-templates mode="bcgtht:clousure.analys.merge.apply.rename.analys" select="$bcgtht:clousure.analys.merge.apply.rename"/>
  84. </xsl:variable>
  85. <xsl:variable name="yed:clousure.analys.merge.apply.graphml">
  86. <xsl:apply-templates mode="yed:graphml" select="$bcgtht:clousure.analys.merge.apply"/>
  87. </xsl:variable>
  88. <xsl:variable name="yed:graphml">
  89. <xsl:apply-templates mode="yed:graphml" select="$bcgtht:clousure"/>
  90. </xsl:variable>
  91. <xsl:variable name="yed:analys.graphml">
  92. <xsl:apply-templates mode="yed:graphml" select="$bcgtht:clousure.analys"/>
  93. </xsl:variable>
  94. <xsl:variable name="bcgtht:clousure.analys.debug">
  95. <xsl:apply-templates mode="bcgtht:clousure.analys.debug" select="$bcgtht:clousure.analys"/>
  96. </xsl:variable>
  97. <xsl:copy-of select="$bcgtht:src_fid_analys" copy-namespaces="no"/>
  98. <xsl:variable name="bcgtht:applying_analys">
  99. <xsl:call-template name="bcgtht:applying_analys">
  100. <xsl:with-param name="bcgtht:src_fid_analys" select="$bcgtht:src_fid_analys"/>
  101. </xsl:call-template>
  102. </xsl:variable>
  103. <xsl:if test="number($bcgtht:debug) &gt; 3">
  104. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.clousure.xml">
  105. <xsl:copy-of select="$bcgtht:clousure"/>
  106. </xsl:result-document>
  107. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.clousure.analys.xml">
  108. <xsl:copy-of select="$bcgtht:clousure.analys"/>
  109. </xsl:result-document>
  110. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.src_fid_analys.xml">
  111. <xsl:copy-of select="$bcgtht:src_fid_analys"/>
  112. </xsl:result-document>
  113. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.applying_analys.xml">
  114. <xsl:copy-of select="$bcgtht:applying_analys"/>
  115. </xsl:result-document>
  116. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.applying_analys.merge.xml">
  117. <xsl:copy-of select="$bcgtht:clousure.analys.merge"/>
  118. </xsl:result-document>
  119. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.applying_analys.merge.apply.xml">
  120. <xsl:copy-of select="$bcgtht:clousure.analys.merge.apply"/>
  121. </xsl:result-document>
  122. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.applying_analys.merge.apply.rename.xml">
  123. <xsl:copy-of select="$bcgtht:clousure.analys.merge.apply.rename"/>
  124. </xsl:result-document>
  125. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.applying_analys.merge.apply.rename.analys.xml">
  126. <xsl:copy-of select="$bcgtht:clousure.analys.merge.apply.rename.analys"/>
  127. </xsl:result-document>
  128. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.yed.graphml">
  129. <xsl:copy-of select="$yed:graphml"/>
  130. </xsl:result-document>
  131. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.yed.analys.graphml">
  132. <xsl:copy-of select="$yed:analys.graphml"/>
  133. </xsl:result-document>
  134. <xsl:result-document href="/Users/a.binder/Downloads/yed.clousure.analys.merge.apply.graphml">
  135. <xsl:copy-of select="$yed:clousure.analys.merge.apply.graphml"/>
  136. </xsl:result-document>
  137. <xsl:result-document href="/Users/a.binder/Downloads/bcgtht.applying_analys.debug.xml">
  138. <xsl:copy-of select="$bcgtht:clousure.analys.debug"/>
  139. </xsl:result-document>
  140. </xsl:if>
  141. <!--<xsl:copy-of select="$applying_analys" copy-namespaces="no"/>-->
  142. <!--<bocian-graph-2-html.preprocess.applying_analys>-->
  143. <xsl:apply-templates mode="bcgtht:applying_analys" select="$bcgtht:applying_analys"/>
  144. <!--</bocian-graph-2-html.preprocess.applying_analys>-->
  145. </xsl:template>
  146. <xsl:template mode="bocian-graph-2-html.preprocess.from_analys" match="*">
  147. <xsl:copy copy-namespaces="no">
  148. <xsl:copy-of select="@*"/>
  149. <xsl:apply-templates mode="#current"/>
  150. </xsl:copy>
  151. </xsl:template>
  152. <xsl:function name="system_cache__dita:bocian.cached">
  153. <system_cache__dita:bocian.cached>
  154. <fid/>
  155. </system_cache__dita:bocian.cached>
  156. </xsl:function>
  157. <xsl:function name="system_cache__dita:bocian.cached">
  158. <xsl:param name="system_cache__dita:bocian.cached"/>
  159. <xsl:param name="fid"/>
  160. <xsl:choose>
  161. <xsl:when test="$system_cache__dita:bocian.cached//fid[@fid=$fid]">
  162. <xsl:message>#158 cached node <xsl:value-of select="$fid"/> - bypasiing </xsl:message>
  163. </xsl:when>
  164. <xsl:otherwise>
  165. <system_cache__dita:bocian.cached>
  166. <xsl:for-each select="$system_cache__dita:bocian.cached//fid">
  167. <xsl:copy-of select="." copy-namespaces="no"/>
  168. </xsl:for-each>
  169. </system_cache__dita:bocian.cached>
  170. </xsl:otherwise>
  171. </xsl:choose>
  172. </xsl:function>
  173. <!--<xsl:template name="bocian-graph-2-html.applying_analys">
  174. <xsl:param name="dst_fid.not.following.count" required="yes"/>
  175. <xsl:param name="dst_fid.following.count" required="yes"/>
  176. <xsl:param name="src_fid_analys" required="yes"/>
  177. <xsl:param name="src_fid" required="yes"/>
  178. <xsl:param name="src_fid.pos" />
  179. <xsl:param name="dst_fid.not.following.pos" select="1"/>
  180. <xsl:param name="dst_fid.following.pos" select="1"/>
  181. <xsl:param name="last_call"/>
  182. <xsl:param name="last_call.pos" />
  183. <xsl:param name="last_call.pos.count" />
  184. <bocian-graph-2-html.applying_analys>
  185. <xsl:choose>
  186. <xsl:when test="not($dst_fid.not.following.count &gt; 0) and not($dst_fid.following.count &gt; 0)">
  187. <TODO>not($dst_fid.not.following.count &gt; 0) and not($dst_fid.following.count &gt; 0)</TODO>
  188. </xsl:when>
  189. <xsl:otherwise>
  190. <xsl:choose>
  191. <xsl:when test="$dst_fid.not.following.pos &lt; $dst_fid.not.following.count and not($last_call='not.following')">
  192. <xsl:for-each select="$src_fid/dst_fid[not(following-sibling)][$dst_fid.not.following.pos]">
  193. <dst_fid_not_following-sibling>
  194. <xsl:copy copy-namespaces="no">
  195. <xsl:copy-of select="@*"/>
  196. </xsl:copy>
  197. </dst_fid_not_following-sibling>
  198. <xsl:call-template name="bocian-graph-2-html.applying_analys">
  199. <xsl:with-param name="src_fid_analys" select="$src_fid_analys"/>
  200. <xsl:with-param name="dst_fid.not.following.count" select="$dst_fid.not.following.count"/>
  201. <xsl:with-param name="dst_fid.following.count" select="$dst_fid.following.count"/>
  202. <xsl:with-param name="src_fid.pos" select="$src_fid.pos"/>
  203. <xsl:with-param name="src_fid" select="$src_fid"/>
  204. <xsl:with-param name="dst_fid.not.following.pos" select="$dst_fid.not.following.pos"/>
  205. <xsl:with-param name="dst_fid.following.pos" select="$dst_fid.following.pos"/>
  206. <xsl:with-param name="last_call" select="'not.following'"/>
  207. <xsl:with-param name="last_call.pos" select="1"/>
  208. <xsl:with-param name="last_call.pos.count" select="count($src_fid/dst_fid[not(following-sibling)][$dst_fid.not.following.pos]/*)"/>
  209. </xsl:call-template>
  210. </xsl:for-each>
  211. </xsl:when>
  212. <!-\-<xsl:when test="$dst_fid.following.pos &lt; $dst_fid.following.count and $last_call = 'not.following'">
  213. <xsl:for-each select="$src_fid/dst_fid[following-sibling][$dst_fid.following.pos]/*">
  214. <dst_fid_not_following-sibling>
  215. <xsl:copy copy-namespaces="no">
  216. <xsl:copy-of select="@*"/>
  217. </xsl:copy>
  218. </dst_fid_not_following-sibling>
  219. <xsl:call-template name="bocian-graph-2-html.applying_analys">
  220. <xsl:with-param name="src_fid_analys" select="$src_fid_analys"/>
  221. <xsl:with-param name="dst_fid.not.following.count" select="$dst_fid.not.following.count"/>
  222. <xsl:with-param name="dst_fid.following.count" select="$dst_fid.following.count"/>
  223. <xsl:with-param name="src_fid.pos" select="$src_fid.pos"/>
  224. <xsl:with-param name="src_fid" select="$src_fid"/>
  225. <xsl:with-param name="dst_fid.not.following.pos" select="$dst_fid.not.following.pos"/>
  226. <xsl:with-param name="dst_fid.following.pos" select="$dst_fid.following.pos + 1"/>
  227. <xsl:with-param name="last_call" select="'not.following'"/>
  228. </xsl:call-template>
  229. </xsl:for-each>
  230. </xsl:when>-\->
  231. <!-\-<xsl:when test="$dst_fid.not.following.pos &lt; $dst_fid.not.following.count and $last_call='not.following'">
  232. </xsl:when>-\->
  233. </xsl:choose>
  234. </xsl:otherwise>
  235. </xsl:choose>
  236. </bocian-graph-2-html.applying_analys>
  237. </xsl:template>-->
  238. <xsl:template mode="bocian-graph-2-html.preprocess.child" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[@fid]">
  239. <xsl:variable name="fileindex" select="@fid"/>
  240. <!--example call module <xsl:for-each select="$dita//simpletable">
  241. <xsl:apply-templates select="." mode="system_cache__dita:graph__write_dita_preprocess">
  242. <xsl:with-param name="fileindex" select="@id"/>
  243. </xsl:apply-templates>
  244. </xsl:for-each> -->
  245. <!-- example xsl from other module
  246. <xsl:result-document href="{$ditadir}/graph_to_image/{$fileindex}.gnuplot" omit-xml-declaration="yes">
  247. set terminal pngcairo font "arial,6" size 800,600
  248. set nokey
  249. set output '<xsl:value-of select="$fileindex"/>.png'
  250. set boxwidth 0.75
  251. set style fill solid
  252. set title "Wykres"
  253. plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 2:xtic(1) with boxes
  254. </xsl:result-document>
  255. -->
  256. <!--<xsl:result-document href="{$ditadir}/graph_to_image/{$fileindex}.gnuplot.dat" omit-xml-declaration="yes">
  257. <!-\-<system_cache__appinfo:graph_to_image.population.dat>-\->
  258. <!-\-<xsl:attribute name="local-name" select="local-name()"/>-\->
  259. <xsl:variable name="cols" select="count(strow[ position() = 1]/stentry)"/>
  260. <xsl:variable name="strow" select="(strow|sthead)"/>
  261. <xsl:message>#69 graph cols <xsl:value-of select="$cols"/></xsl:message>
  262. <xsl:for-each select="1 to $cols">
  263. <xsl:for-each select="$strow/stentry[ position() = current()]">
  264. <xsl:choose>
  265. <xsl:when test="position() = 1">
  266. <!-\-<xsl:value-of select="system_cache__appinfo:truncate_special_and_do_uppercase(.)"/><xsl:text>&#09;</xsl:text>-\->
  267. <xsl:value-of select="string(.)"/><xsl:text>&#09;</xsl:text>
  268. </xsl:when>
  269. <xsl:otherwise>
  270. <xsl:value-of select="string(.)"/><xsl:text>&#09;</xsl:text>
  271. </xsl:otherwise>
  272. </xsl:choose>
  273. </xsl:for-each>
  274. <xsl:text>&#10;</xsl:text>
  275. </xsl:for-each>
  276. <!-\-</system_cache__appinfo:graph_to_image.population.dat>-\->
  277. <!-\-<xsl:apply-templates mode="preprocess_gml_geometry_image" select="."/>-\->
  278. </xsl:result-document>-->
  279. <gml:featureMember >
  280. <xsl:element name="default_db__x3A__{BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/local-name()}:{BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/local-name()}">
  281. <xsl:attribute name="p5:primaryKey" select="p5:primaryKey(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid)"/>
  282. <xsl:copy-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid"/>
  283. <!--<default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY fid="{@fid}">-->
  284. <!--<xsl:attribute name="p5:primaryKey" select="p5:primaryKey(@fid)"/>-->
  285. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.names" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]"/>
  286. <!--<default_db__x3A__BI_audit_ENERGA_PRACOWNICY:ID>12</default_db__x3A__BI_audit_ENERGA_PRACOWNICY:ID>
  287. <default_db__x3A__BI_audit_ENERGA_PRACOWNICY:imiona>Robert</default_db__x3A__BI_audit_ENERGA_PRACOWNICY:imiona>
  288. <default_db__x3A__BI_audit_ENERGA_PRACOWNICY:nazwisko>Szaj</default_db__x3A__BI_audit_ENERGA_PRACOWNICY:nazwisko>-->
  289. <xsl:variable name="pos.last" select="count(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object)"/>
  290. <xsl:element name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  291. <xsl:copy-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/@fid"/>
  292. <xsl:attribute name="p5:primaryKey" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/p5:primaryKey(@fid)"/>
  293. <default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:ID><xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/p5:primaryKey(@fid)"/></default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:ID>
  294. <xsl:comment>#109 parent once </xsl:comment>
  295. <xsl:element name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row">
  296. <xsl:copy-of select="@fid"/>
  297. <xsl:attribute name="p5:primaryKey" select="p5:primaryKey(@fid)"/>
  298. <default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:ID><xsl:value-of select="p5:primaryKey(@fid)"/></default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:ID>
  299. <xsl:comment>#109 parent root </xsl:comment>
  300. <xsl:variable name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row" select="."/>
  301. <xsl:for-each select="0 to ( $pos.last - 1 )">
  302. <xsl:comment>#133 1 to <xsl:value-of select="$pos.last"/> = <xsl:value-of select="$pos.last - current()"/></xsl:comment>
  303. <xsl:for-each select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ ($pos.last - current()) ]">
  304. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.row_objects" select="." >
  305. <xsl:with-param name="pos" select="position()"/>
  306. <xsl:with-param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object" select="."/>
  307. </xsl:apply-templates>
  308. </xsl:for-each>
  309. </xsl:for-each>
  310. <!--<xsl:apply-templates mode="bocian-graph-2-html.preprocess.row_objects" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]" >
  311. <xsl:with-param name="pos" select="2"/>
  312. <xsl:with-param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object" select="."/>
  313. </xsl:apply-templates>-->
  314. </xsl:element>
  315. </xsl:element>
  316. <!--<xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ not(position()=1)]" >-->
  317. <!--<xsl:call-template name="bocian-graph-2-html.preprocess.row_objects" />-->
  318. <!--</xsl:for-each>-->
  319. <!-- mode="bocian-graph-2-html.preprocess.row_objects" -->
  320. <!--</default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY>-->
  321. </xsl:element>
  322. </gml:featureMember>
  323. </xsl:template>
  324. <xsl:template name="bocian-graph-2-html.preprocess.row_objects">
  325. <bocian-graph-2-html.preprocess.row_objects>
  326. <xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ not(position()=1)]" >
  327. <OBJ>
  328. </OBJ>
  329. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.row_objects" select="."/>
  330. </xsl:for-each>
  331. </bocian-graph-2-html.preprocess.row_objects>
  332. </xsl:template>
  333. <xsl:template mode="bocian-graph-2-html.preprocess bocian-graph-2-html.preprocess.child bocian-graph-2-html.preprocess.applying_analys" match="text()|comment()|*"/>
  334. <xsl:function name="system_cache__dita:bocian.add.elements">
  335. <xsl:param name="local-name"/>
  336. <xsl:choose>
  337. <xsl:when test="contains($local-name,'default_db__x3A__')">
  338. <xsl:value-of select="$local-name"/>
  339. </xsl:when>
  340. <xsl:otherwise>
  341. <xsl:value-of select="concat('default_db__x3A__',$local-name,':',$local-name)"/>
  342. </xsl:otherwise>
  343. </xsl:choose>
  344. </xsl:function>
  345. <xsl:template mode="bocian-graph-2-html.preprocess.names" match="*[*]">
  346. <xsl:param name="addelement"/>
  347. <xsl:choose>
  348. <xsl:when test="$addelement">
  349. <xsl:choose>
  350. <xsl:when test="contains(name(),'default_db__x3A__')">
  351. <xsl:copy copy-namespaces="no">
  352. <xsl:copy-of select="@fid"/>
  353. <xsl:attribute name="p5:primaryKey" select="p5:primaryKey(@fid)"/>
  354. <xsl:apply-templates mode="#current">
  355. <xsl:with-param name="addelement" select="$addelement"/>
  356. </xsl:apply-templates>
  357. </xsl:copy>
  358. </xsl:when>
  359. <xsl:otherwise>
  360. <xsl:element name="default_db__x3A__{local-name()}:{local-name()}">
  361. <xsl:copy-of select="@fid"/>
  362. <xsl:attribute name="p5:primaryKey" select="p5:primaryKey(@fid)"/>
  363. <xsl:apply-templates mode="#current">
  364. <xsl:with-param name="addelement" select="$addelement"/>
  365. </xsl:apply-templates>
  366. </xsl:element>
  367. </xsl:otherwise>
  368. </xsl:choose>
  369. </xsl:when>
  370. <xsl:otherwise>
  371. <xsl:apply-templates mode="#current"/>
  372. </xsl:otherwise>
  373. </xsl:choose>
  374. </xsl:template>
  375. <xsl:function name="system_cache__dita:bocian.bypass.elements">
  376. <xsl:param name="element"/>
  377. <xsl:choose>
  378. <xsl:when test="$element = 'relation_from'"/>
  379. <xsl:when test="$element = 'BI_audit_MSIG_person'"/>
  380. <xsl:when test="$element = 'BI_audit_KRS_person'"/>
  381. <xsl:when test="$element = 'BI_audit_MSIG_company'"/>
  382. <xsl:when test="$element = 'BI_audit_KRS_company'"/>
  383. <xsl:when test="$element = 'BI_audit_taxpayer'"/>
  384. <xsl:when test="$element = 'TERYT_adresy'"/>
  385. <xsl:when test="$element = 'BI_audit_MSIG_address'"/>
  386. <xsl:otherwise><xsl:value-of select="true()"/></xsl:otherwise>
  387. </xsl:choose>
  388. </xsl:function>
  389. <xsl:template match="relation_from|BI_audit_MSIG_person|BI_audit_KRS_person|BI_audit_MSIG_company|BI_audit_KRS_company|BI_audit_taxpayer|TERYT_adresy|BI_audit_MSIG_address" mode="bocian-graph-2-html.preprocess.names" priority="5"/>
  390. <xsl:template mode="bocian-graph-2-html.preprocess.names" match="ID|imiona|nazwisko|Pelna_nazwa_kontrahenta|nazwa"> <!-- |*[not(*)] -->
  391. <xsl:element name="default_db__x3A__{parent::*/local-name()}:{local-name()}">
  392. <xsl:if test="local-name()='nazwa'"><xsl:value-of select="parent::*/name()"/></xsl:if><xsl:value-of select="text()"/>
  393. <!--<xsl:if test="local-name()='ID'"><xsl:comment>#201 parent/name=<xsl:value-of select="parent::*/name()"/></xsl:comment></xsl:if>-->
  394. </xsl:element>
  395. </xsl:template>
  396. <xsl:template mode="bocian-graph-2-html.preprocess.names" match="text()|comment()"/>
  397. <xsl:template mode="bocian-graph-2-html.preprocess.row_objects" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  398. <xsl:param name="pos" required="yes"/>
  399. <xsl:param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object" required="yes"/>
  400. <!--<bocian-graph-2-html.preprocess.row_objects pos="{$pos}" cnt="{count($BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object//*)}">-->
  401. <xsl:variable name="test_child">
  402. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.names" >
  403. <xsl:with-param name="addelement" select="true()"/>
  404. </xsl:apply-templates>
  405. </xsl:variable>
  406. <xsl:choose>
  407. <xsl:when test="$test_child//*">
  408. <default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object fid="{@fid}" >
  409. <xsl:namespace name="default_db__x3A__{*[1]/local-name()}">https://biuro.biall-net.pl/wfs/default_db/<xsl:value-of select="*[1]/local-name()"/></xsl:namespace>
  410. <xsl:attribute name="p5:primaryKey" select="p5:primaryKey(@fid)"/>
  411. <default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:ID><xsl:value-of select="p5:primaryKey(@fid)"/></default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:ID>
  412. <!--<xsl:element name="{*[1]/name()}"></xsl:element>-->
  413. <xsl:apply-templates mode="bocian-graph-2-html.preprocess.names" >
  414. <xsl:with-param name="addelement" select="true()"/>
  415. </xsl:apply-templates>
  416. <!--<xsl:apply-templates mode="#current" select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ $pos + 1]" >
  417. <xsl:with-param name="pos" select="$pos + 1"/>
  418. <xsl:with-param name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object" select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"/>
  419. </xsl:apply-templates>-->
  420. </default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object>
  421. </xsl:when>
  422. </xsl:choose>
  423. <!--</bocian-graph-2-html.preprocess.row_objects>-->
  424. </xsl:template>
  425. <xsl:template mode="bocian-graph-2-html.preprocess" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
  426. <xsl:message terminate="yes">#73 match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object" without @fid !</xsl:message>
  427. </xsl:template>
  428. <xsl:template mode="system_cache__dita:bocian-graph-2-html.write" match="*">
  429. </xsl:template>
  430. <xsl:template mode="system_cache__dita:bocian-graph-2-html.read" match="*">
  431. <xsl:param name="fileindex" required="yes"/> <!-- ex. 3161_IN7_MK_BAZA_DYSTRYBUCJI - is related dir in dita dir with images -->
  432. <xsl:param name="width" select="500"/>
  433. <!-- example usage from other module
  434. <p> Ilości powiązań <note>Uwaga, w przypadku odnalezionych kilku tras do tego samego kontrahenta pokazywana jest jedna trasa (wykres nie zawiera tego ograniczenia)</note>
  435. <xsl:copy-of select="$simpletable"/>
  436. <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
  437. <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
  438. <xsl:with-param name="width" select="500"/>
  439. </xsl:apply-templates>
  440. </p>
  441. -->
  442. <xsl:choose>
  443. <xsl:when test="doc-available(concat($ditadir,'/bocian-graph-2-html/',$fileindex,'.png.xml'))">
  444. <!--<xsl:apply-templates mode="system_cache__dita:graph_to_image" select="doc(concat($ditadir,'/graph_to_image/',$fileindex,'.png.xml'))">
  445. <xsl:with-param name="fileindex" select="$fileindex"/>
  446. <xsl:with-param name="width" select="$width"/>
  447. </xsl:apply-templates>-->
  448. <image href="bocian-graph-2-html/{$fileindex}.png" width="500"/>
  449. </xsl:when>
  450. <xsl:otherwise>
  451. <xsl:comment>#190 doc not aviable <xsl:value-of select="concat($ditadir,'/bocian-graph-2-html/',$fileindex,'.png.xml')"/></xsl:comment>
  452. <xsl:message>#190 doc not aviable <xsl:value-of select="concat($ditadir,'/bocian-graph-2-html/',$fileindex,'.png.xml')"/></xsl:message>
  453. </xsl:otherwise>
  454. </xsl:choose>
  455. <xsl:comment>#180 todo mode="system_cache__dita:bocian-graph-2-html.read" match="*" name=<xsl:value-of select="name()"/></xsl:comment>
  456. </xsl:template>
  457. <xsl:template mode="system_cache__dita:bocian-graph-2-html.read" match="bocian-graph-2-html">
  458. <!-- integration in echoxml file="${postprocess_modules.xml} -->
  459. <xsl:param name="fileindex" required="yes"/> <!-- ex. 3161_IN7_MK_BAZA_DYSTRYBUCJI - is related dir in dita dir with images -->
  460. <xsl:param name="width" select="500"/>
  461. <xsl:comment>#85 todo mode="system_cache__dita:bocian-graph-2-html" match="bocian-graph-2-html"</xsl:comment>
  462. <!--<xsl:apply-templates mode="system_cache__appinfo:images">
  463. <xsl:with-param name="fileindex" select="$fileindex"/>
  464. <xsl:with-param name="width" select="$width"/>
  465. </xsl:apply-templates>-->
  466. </xsl:template>
  467. </xsl:stylesheet>