bcgtht.tree_to_dita..xsl 36 KB

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