bcgtht.tree_to_dita.xsl 40 KB

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