graph.xsl 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:wfs="http://www.opengis.net/wfs"
  5. xmlns:gml="http://www.opengis.net/gml"
  6. xmlns:xlink="http://www.w3.org/1999/xlink"
  7. xmlns:p5dg="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/documentation_generator/documentation_generator.xsd"
  8. xmlns:get_wfs_recurse_xsl="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/get_wfs_recurse_xsl.xsd"
  9. xmlns:y="http://www.yworks.com/xml/graphml"
  10. xmlns:graph="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/graph/graph.xsd"
  11. xmlns:p5ant="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd"
  12. exclude-result-prefixes="xs"
  13. version="2.0">
  14. <xsl:output indent="yes"/>
  15. <xsl:strip-space elements="*"/>
  16. <xsl:param name="nazwisko" select="'siurni'"/>
  17. <xsl:param name="limit_rec" select="99999999"/>
  18. <xsl:param name="graph_title" select="'Arkadiusz Binder/RIP Graficzna prezentacja wybranych par raportu dla podanych KRS 2017-08-09'"/>
  19. <xsl:param name="graph_desc" select="'Uwaga - limit 10 umow'"/>
  20. <xsl:param name="bypass_nodes_string" select="'(.*XXXXBI_audit_MSIG_nameXXXX.*)|(.*BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row)'"/>
  21. <xsl:param name="not_bypass_nodes_string" select="'xxxxxxxBI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object'"/>
  22. <xsl:param name="graph:debug" select="0"/>
  23. <xsl:param name="graph.graph-to-analyze-property.xml"/>
  24. <xsl:template name="graph:property.evaluated">
  25. <xsl:param name="property.name" required="yes"/>
  26. <xsl:param name="graph:property.eval" required="yes"/>
  27. <xsl:param name="p5dg:p5ant.include.structure" required="yes"/>
  28. <xsl:param name="graph:property.evaluated.recurse_level" select="1"/>
  29. <xsl:param name="p5ant:dir" required="yes"/>
  30. <xsl:param name="p5dg:basedir" required="yes"/>
  31. <!--<xsl:variable name="graph:property.eval.esc" select="replace($graph:property.eval,'\$','\\\$')"/>-->
  32. <xsl:choose>
  33. <xsl:when test="$graph:property.evaluated.recurse_level &gt; 5">
  34. <xsl:message>#38 ERROR RECURSE $graph:property.evaluated.recurse_level=<xsl:value-of select="$graph:property.evaluated.recurse_level"/></xsl:message>
  35. <graph:property.evaluated.recurse_level>
  36. <xsl:attribute name="graph:property.evaluated.recurse_level" select="$graph:property.evaluated.recurse_level"/>
  37. </graph:property.evaluated.recurse_level>
  38. </xsl:when>
  39. <xsl:when test=" contains($graph:property.eval,'\$') or 1=1">
  40. <xsl:variable name="tokens">
  41. <tokens>
  42. <!--<xsl:attribute name="graph:property.eval.esc" select="$graph:property.eval.esc"/>-->
  43. <xsl:for-each select="tokenize($graph:property.eval,'\$\{')">
  44. <xsl:variable name="ifeval" select="contains(.,'}')"/>
  45. <lt>
  46. <xsl:attribute name="ifeval" select="$ifeval"/>
  47. <xsl:attribute name="pos" select="position()"/>
  48. <xsl:attribute name="val" select="."/>
  49. <xsl:for-each select="tokenize(.,'\}')">
  50. <rt>
  51. <xsl:attribute name="pos" select="position()"/>
  52. <xsl:value-of select="."/>
  53. </rt>
  54. </xsl:for-each>
  55. </lt>
  56. </xsl:for-each>
  57. </tokens>
  58. </xsl:variable>
  59. <!--<xsl:variable name="property.value" select=" replace($graph:property.eval,'\$','\\\$')"/>-->
  60. <!--<xsl:variable name="property.value.evaluated" select="$p5dg:p5ant.include.structure//property[]"/>-->
  61. <xsl:if test=" number($graph:debug) &gt; 3"><xsl:copy-of select="$tokens"/></xsl:if>
  62. <xsl:variable name="evaluating">
  63. <evaluating>
  64. <xsl:for-each select="$tokens/tokens/lt">
  65. <xsl:variable name="ifeval" select="@ifeval"/>
  66. <xsl:for-each select="rt">
  67. <xsl:choose>
  68. <xsl:when test="@pos='1'">
  69. <xsl:choose>
  70. <xsl:when test=" text()='basedir' and not( contains($p5dg:basedir,'${'))">
  71. <!--<xsl:value-of select="'BASEDIR_CALCULATE_BY_p5ant:file'"/>-->
  72. <!-- <xsl:text>
  73. $p5ant:dir=</xsl:text><xsl:value-of select="$p5ant:dir"/>
  74. <xsl:text>
  75. p5ant:basedir.calculate=</xsl:text>-->
  76. <!--<xsl:choose>
  77. <xsl:when test=" contains($p5dg:basedir,'${')">
  78. <xsl:variable name="evaluated" select="($p5dg:p5ant.include.structure//property[@name=current() and not(@value=concat('${', current(),'}'))])[1]/concat(@value,@location)"/>
  79. </xsl:when>
  80. </xsl:choose>-->
  81. <xsl:value-of select="p5ant:basedir.calculate($p5ant:dir,$p5dg:basedir)"/>
  82. </xsl:when>
  83. <xsl:otherwise>
  84. <xsl:variable name="evaluated" select="($p5dg:p5ant.include.structure//property[@name=current() and not(@value=concat('${', current(),'}'))])[1]/concat(@value,@location)"/>
  85. <xsl:choose>
  86. <xsl:when test="$evaluated">
  87. <xsl:value-of select="$evaluated"/>
  88. </xsl:when>
  89. <xsl:otherwise>
  90. <xsl:text>{</xsl:text><xsl:value-of select="current()"/><xsl:text>}</xsl:text>
  91. </xsl:otherwise>
  92. </xsl:choose>
  93. </xsl:otherwise>
  94. </xsl:choose>
  95. </xsl:when>
  96. <xsl:otherwise>
  97. <!--<xsl:text>F:</xsl:text>--><xsl:value-of select="."/>
  98. </xsl:otherwise>
  99. </xsl:choose>
  100. </xsl:for-each>
  101. </xsl:for-each>
  102. </evaluating>
  103. </xsl:variable>
  104. <xsl:choose>
  105. <xsl:when test=" contains($evaluating/evaluating/text(),'${')">
  106. <xsl:message>#104 recurrent eval <xsl:value-of select="$evaluating//text()"/></xsl:message>
  107. <recurse_evaluating>
  108. <xsl:attribute name="evaluating" select="$evaluating/evaluating/text()"/>
  109. <xsl:call-template name="graph:property.evaluated">
  110. <xsl:with-param name="property.name" select="$property.name"/>
  111. <xsl:with-param name="graph:property.eval" select="$evaluating/evaluating/text()"/>
  112. <xsl:with-param name="p5dg:p5ant.include.structure" select="$p5dg:p5ant.include.structure"/>
  113. <xsl:with-param name="graph:property.evaluated.recurse_level" select="$graph:property.evaluated.recurse_level + 1"/>
  114. <xsl:with-param name="p5ant:dir" select="$p5ant:dir"/>
  115. <xsl:with-param name="p5dg:basedir" select="$p5dg:basedir"/>
  116. </xsl:call-template>
  117. </recurse_evaluating>
  118. </xsl:when>
  119. <xsl:otherwise>
  120. <graph:property.evaluated>
  121. <xsl:value-of select="$evaluating"/>
  122. </graph:property.evaluated>
  123. </xsl:otherwise>
  124. </xsl:choose>
  125. </xsl:when>
  126. </xsl:choose>
  127. </xsl:template>
  128. <xsl:function name="p5ant:basedir.calculate">
  129. <xsl:param name="p5ant:dir"/>
  130. <xsl:param name="p5dg:basedir"/>
  131. <xsl:variable name="basedir_roots" select="count(tokenize($p5dg:basedir,'../'))"/>
  132. <xsl:variable name="result">
  133. <xsl:for-each select="tokenize($p5ant:dir,'/')[ position() &lt;= ( count(tokenize($p5ant:dir,'/')) - $basedir_roots + 1 ) ]">
  134. <xsl:value-of select="'/'"/><xsl:value-of select="."/>
  135. </xsl:for-each>
  136. <xsl:choose>
  137. <xsl:when test="$basedir_roots &gt; 0">
  138. <xsl:text>/</xsl:text>
  139. <xsl:choose>
  140. <xsl:when test=" tokenize($p5dg:basedir,'/')[ position()=$basedir_roots]='.'"/>
  141. <xsl:otherwise>
  142. <xsl:value-of select=" tokenize($p5dg:basedir,'/')[ position()=$basedir_roots]"/>
  143. </xsl:otherwise>
  144. </xsl:choose>
  145. </xsl:when>
  146. <xsl:otherwise>
  147. <xsl:text>/</xsl:text>
  148. <xsl:choose>
  149. <xsl:when test="$p5dg:basedir='.'"></xsl:when>
  150. <xsl:otherwise><xsl:value-of select="$p5dg:basedir"/></xsl:otherwise>
  151. </xsl:choose>
  152. </xsl:otherwise>
  153. </xsl:choose>
  154. </xsl:variable>
  155. <xsl:value-of select="replace($result,'//','/')"/>
  156. </xsl:function>
  157. <xsl:template mode="graph:graph.graph-to-analyze-property.xml" match="p5dg:p5ant.include.structure">
  158. <graph:graph.graph-to-analyze-property.xml>
  159. <!--<xsl:apply-templates mode="#current"/>-->
  160. <xsl:variable name="p5dg:p5ant.include.structure" select="."/>
  161. <xsl:for-each-group select=".//property[ position() &lt; 100 or contains(@name,'php_session') ]" group-by="@value">
  162. <xsl:copy copy-namespaces="no" exclude-result-prefixes="#all">
  163. <xsl:copy-of select="@*"/>
  164. <xsl:attribute name="p5ant:dir" select=" ancestor::node()[name()='p5ant:file']/@p5ant:dir"/>
  165. <xsl:variable name="property.name" select="@name"/>
  166. <xsl:variable name="property.value" select=" replace(@value,'\$','\\\$')"/>
  167. <!--<xsl:variable name="match"><xsl:text><![CDATA[\\$\{]]></xsl:text><xsl:value-of select="$property.name"/><xsl:text><![CDATA[}]]></xsl:text></xsl:variable>-->
  168. <!--<xsl:variable name="match"><xsl:value-of select="$property.name"/></xsl:variable>-->
  169. <xsl:variable name="match"><xsl:text>\$\{</xsl:text><xsl:value-of select="$property.name"/><xsl:text>\}</xsl:text></xsl:variable>
  170. <xsl:message>#35 match is <xsl:value-of select="$match"/></xsl:message>
  171. <!--<graph:property.evals>
  172. <xsl:for-each select="root()/xxxxxxx/property[ matches(@value,concat('(.*',$match,'.*)'))]"> <!-\- \\$\{ -\->
  173. <xsl:copy exclude-result-prefixes="#all" copy-namespaces="no">
  174. <xsl:copy-of select="@*"/>
  175. <xsl:variable name="to.replace.value" select="replace(@value,'\$','\\\$')"/>
  176. <xsl:attribute name="graph:property.eval" select='replace(@value, $match , $property.value)'/>
  177. <xsl:attribute name="graph:property.eval.from" select="$property.name"/>
  178. </xsl:copy>
  179. </xsl:for-each>
  180. </graph:property.evals>-->
  181. <xsl:choose>
  182. <xsl:when test=" contains($property.value,'${')"> <!-- contains(replace(@value, $match , $property.value),'\$') -->
  183. <xsl:variable name="graph:property.evaluated">
  184. <xsl:call-template name="graph:property.evaluated">
  185. <xsl:with-param name="graph:property.eval" select="@value"/>
  186. <xsl:with-param name="p5dg:p5ant.include.structure" select="$p5dg:p5ant.include.structure"/>
  187. <xsl:with-param name="property.name" select="$property.name"/>
  188. <xsl:with-param name="p5ant:dir" select=" ancestor::node()[name()='p5ant:file']/@p5ant:dir"/>
  189. <xsl:with-param name="p5dg:basedir" select="@p5dg:basedir"/>
  190. </xsl:call-template>
  191. </xsl:variable>
  192. <xsl:attribute name="graph:property.evaluated" select="$graph:property.evaluated//graph:property.evaluated/text()"/>
  193. <xsl:if test="number($graph:debug) &gt;3"><xsl:copy-of select="$graph:property.evaluated"/></xsl:if>
  194. </xsl:when>
  195. <xsl:otherwise>
  196. <xsl:attribute name="graph:property.evaluated.not_needed" select="true()"/>
  197. </xsl:otherwise>
  198. </xsl:choose>
  199. </xsl:copy>
  200. </xsl:for-each-group>
  201. </graph:graph.graph-to-analyze-property.xml>
  202. </xsl:template>
  203. <xsl:template mode="graph:graph.graph-to-analyze.xml" match="p5dg:p5ant.include.structure">
  204. <graph:graph.graph-to-analyze.xml>
  205. <!--<xsl:apply-templates mode="#current"/>-->
  206. <xsl:variable name="graph:graph.graph-to-analyze-property.xml" select="doc($graph.graph-to-analyze-property.xml)"/>
  207. <xsl:for-each select=".//(p5dg:p5ant.include.structure.ant.build|p5dg:p5ant.include.structure.ant.build.target|p5dg:p5ant.include.structure.ant.build.child.target.antcall|p5dg:p5ant.include.structure.ant.build.child.target.ant)">
  208. <!--<xsl:message>#135OKOK trasa <xsl:value-of select="position()"/> <xsl:value-of select="@fid"/></xsl:message>-->
  209. <xsl:element name="{name()}" exclude-result-prefixes="#all" >
  210. <!--<xsl:namespace name="{ substring-before(name(),':')}" select="substring-before(name(),':')"/>-->
  211. <xsl:copy-of select="@*"/>
  212. <xsl:copy-of select="../@p5ant:dir.parent"/>
  213. <xsl:copy-of select="../@p5ant:dir"/>
  214. <xsl:copy-of select="../@p5ant:uuid"/>
  215. <xsl:attribute name="p5ant:file" select="../@p5ant:file"/>
  216. <xsl:attribute name="pos" select="position()"/>
  217. <xsl:if test="../@fid"><xsl:attribute name="parent" select="../@fid"/></xsl:if>
  218. <xsl:choose>
  219. <xsl:when test="project">
  220. <xsl:attribute name="fid" select="concat( name(*),'_','.', ../@p5ant:uuid)"/>
  221. </xsl:when>
  222. <xsl:when test="target|extension-point">
  223. <xsl:attribute name="fid" select="concat( name(*),'_','.', @p5ant:uuid)"/>
  224. <xsl:attribute name="fid.parent" select=" ancestor::project[ position() = 1]/concat( name(),'_',@name,'.', ../@p5ant:uuid)"/>
  225. </xsl:when>
  226. <xsl:when test="ant">
  227. <xsl:attribute name="fid" select="concat( name(*),'_','.', @p5ant:uuid)"/>
  228. <xsl:attribute name="fid.parent" select=" ancestor::project[ position() = 1]/concat( name(),'_',@name,'.', ../@p5ant:uuid)"/>
  229. </xsl:when>
  230. <xsl:when test="antcall">
  231. <xsl:attribute name="fid" select="concat( @p5dg:name,'_','.', ../@p5ant:uuid)"/>
  232. <xsl:attribute name="fid.parent" select=" ancestor::target[position() = 1]/concat( @p5dg:name,'_',@name,'.', ../@p5ant:uuid)"/>
  233. </xsl:when>
  234. <xsl:otherwise>
  235. <xsl:attribute name="fid" select="concat( name(*),'_','.', ../@p5ant:uuid)"/> <!-- @name -->
  236. <xsl:attribute name="fid.parent" select=" ancestor::project[position() = 1]/concat( name(*),'_',@name,'.', ../@p5ant:uuid)"/>
  237. </xsl:otherwise>
  238. </xsl:choose>
  239. <xsl:apply-templates mode="graph:graph.graph-to-analyze.xml.child">
  240. <xsl:with-param name="graph:graph.graph-to-analyze-property.xml" select="$graph:graph.graph-to-analyze-property.xml"/>
  241. </xsl:apply-templates>
  242. </xsl:element>
  243. </xsl:for-each>
  244. </graph:graph.graph-to-analyze.xml>
  245. </xsl:template>
  246. <xsl:template match="p5dg:p5ant.include.structure.ant.build|p5dg:p5ant.include.structure.ant.build.child.target.antcall|p5dg:p5ant.include.structure.ant.build.child.target.ant" mode="graph:graph.graph-to-analyze.xml.child">
  247. <xsl:param name="graph:graph.graph-to-analyze-property.xml" required="yes"/>
  248. <xsl:copy>
  249. <xsl:copy-of select="@*"/>
  250. </xsl:copy>
  251. </xsl:template>
  252. <xsl:template match="*" mode="graph:graph.graph-to-analyze.xml.child">
  253. <xsl:param name="graph:graph.graph-to-analyze-property.xml" required="yes"/>
  254. <xsl:copy>
  255. <xsl:copy-of select="@*"/>
  256. <xsl:apply-templates mode="graph:graph.graph-to-analyze.xml.child" select="@*">
  257. <xsl:with-param name="graph:graph.graph-to-analyze-property.xml" select="$graph:graph.graph-to-analyze-property.xml"/>
  258. </xsl:apply-templates>
  259. <xsl:apply-templates mode="#current">
  260. <xsl:with-param name="graph:graph.graph-to-analyze-property.xml" select="$graph:graph.graph-to-analyze-property.xml"/>
  261. </xsl:apply-templates>
  262. </xsl:copy>
  263. </xsl:template>
  264. <xsl:template match="@value[../property]" mode="graph:graph.graph-to-analyze.xml.child">
  265. <xsl:param name="graph:graph.graph-to-analyze-property.xml" required="yes"/>
  266. <xsl:choose>
  267. <xsl:when test="../@graph:property.evaluated"><xsl:attribute name="value" select="../@graph:property.evaluated"/></xsl:when>
  268. <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
  269. </xsl:choose>
  270. </xsl:template>
  271. <xsl:template match="@*" mode="graph:graph.graph-to-analyze.xml.child">
  272. <xsl:copy-of select="."/>
  273. </xsl:template>
  274. <xsl:template mode="graph:graph.graph-to-nodes.xml" match="graph:graph.graph-to-analyze.xml">
  275. <graph.graph-to-nodes.xml>
  276. <xsl:for-each-group select="*" group-by="@fid">
  277. <xsl:comment>#142 create-nodes-BI-wfs for @fid=<xsl:value-of select="@fid"/>;</xsl:comment>
  278. <xsl:apply-templates mode="graph:create-nodes" select="." />
  279. </xsl:for-each-group>
  280. <xsl:for-each-group select="*" group-by="@fid">
  281. <xsl:comment>#142 create-nodes-BI-wfs for @fid=<xsl:value-of select="@fid"/>;</xsl:comment>
  282. <xsl:apply-templates mode="graph:create-edges" select="." />
  283. </xsl:for-each-group>
  284. </graph.graph-to-nodes.xml>
  285. </xsl:template>
  286. <xsl:template match="*" mode="graph:create-nodes" >
  287. <xsl:element name="node" namespace="http://graphml.graphdrawing.org/xmlns">
  288. <xsl:attribute name="id">
  289. <!--<xsl:value-of select="concat(name(),'_',@pos)"/>-->
  290. <xsl:value-of select="replace(@fid,'\.','_')"/>
  291. </xsl:attribute>
  292. <!--<xsl:attribute name="deb.fid" select="@fid"/>-->
  293. <!--<xsl:attribute name="deb.fid2" select=" text()"/>-->
  294. <data key="d0" xmlns="http://graphml.graphdrawing.org/xmlns">
  295. <y:ShapeNode>
  296. <!--<y:Geometry height="{ ((count(*[not( local-name()='ID') and not( matches(local-name(),'(S_*)|(A_)|(TERYT.*)'))]) * 18) + 70)}" width="600"/>--><!-- { count(*) * 10} -->
  297. <!--<y:Fill color="#CCCCCC"/>-->
  298. <y:Geometry height="100" width="600"/>
  299. <y:Fill transparent="false">
  300. <xsl:attribute name="color">
  301. <!--<xsl:value-of select="$colors/colors/object_hex[ @name = current()/local-name() or @name='*'][1]/text()" xpath-default-namespace=""/>-->
  302. <xsl:value-of select="'#666666'" xpath-default-namespace=""/>
  303. </xsl:attribute>
  304. </y:Fill><!--<xsl:value-of select="local-name()"/>-->
  305. <!--<y:NodeLabel width="400" height="{ ((count(*[not( local-name()='ID') and not( matches(local-name(),'(S_*)|(A_)|(TERYT.*)'))]) * 18) + 70)}">&lt;html&gt;&lt;div
  306. style="font-size:120%;color:black;"&gt;
  307. <xsl:value-of select="ID"/>&lt;br&gt;
  308. <xsl:value-of select=" substring(name(),10)"/>&lt;br&gt;
  309. <xsl:for-each select="*[not( local-name()='ID') and not( matches(local-name(),'(S_*)|(A_)|(TERYT.*)'))]" xpath-default-namespace="http://graphml.graphdrawing.org/xmlns">
  310. <xsl:value-of select=" substring(local-name(),0,10)"/><xsl:text> : </xsl:text><xsl:value-of select=" substring(.,0,20)"/> <!-\-<xsl:for-each select="text()"><xsl:value-of select="substring(text(),20)"/></xsl:for-each>-\->&lt;br&gt;
  311. </xsl:for-each>
  312. &lt;/div&gt;
  313. </y:NodeLabel>-->
  314. <y:NodeLabel width="400" height="100">&lt;html&gt;&lt;div
  315. style="font-size:120%;color:black;"&gt;
  316. <xsl:value-of select="ID"/>&lt;br&gt;
  317. <xsl:value-of select=" substring(name(),10)"/>&lt;br&gt;
  318. <xsl:for-each select="*[not( local-name()='ID') and not( matches(local-name(),'(S_*)|(A_)|(TERYT.*)'))]" xpath-default-namespace="http://graphml.graphdrawing.org/xmlns">
  319. <xsl:value-of select=" substring(local-name(),0,10)"/><xsl:text> : </xsl:text><xsl:value-of select=" substring(.,0,20)"/> <!--<xsl:for-each select="text()"><xsl:value-of select="substring(text(),20)"/></xsl:for-each>-->&lt;br&gt;
  320. </xsl:for-each>
  321. &lt;/div&gt;
  322. </y:NodeLabel>
  323. </y:ShapeNode>
  324. </data>
  325. </xsl:element>
  326. </xsl:template>
  327. <xsl:template match="*[@fid]" mode="graph:create-edges" priority="5" >
  328. <!--<default_db__x3A__BI_audit_KRS_person:BI_audit_KRS_person
  329. xlink:href="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS_person#BI_audit_KRS_person.150746"/>-->
  330. <!-- <xsl:param name="pos" required="yes"/>
  331. <xsl:param name="next" required="yes"/>-->
  332. <xsl:comment>#273parent <xsl:value-of select="@parent"/></xsl:comment>
  333. <xsl:choose>
  334. <xsl:when test="@fid">
  335. <xsl:element name="edge" namespace="http://graphml.graphdrawing.org/xmlns">
  336. <!--<xsl:attribute name="debug.279" select="1"/>-->
  337. <xsl:attribute name="id">
  338. <xsl:value-of select="generate-id()"/>
  339. </xsl:attribute>
  340. <xsl:attribute name="source">
  341. <!--<xsl:value-of select="concat(name(),'_',@pos)"/>-->
  342. <xsl:value-of select="replace(@fid,'\.','_')"/>
  343. </xsl:attribute>
  344. <xsl:attribute name="target">
  345. <!--<xsl:value-of select="$next[1]/concat(name(), '_',@pos)"/>-->
  346. <xsl:value-of select="replace(@fid.parent,'\.','_')"/>
  347. </xsl:attribute>
  348. <!--<xsl:attribute name="deb.ref" select="../*[@fid = current()/substring-after(@xlink:href,'#')]"/>-->
  349. <y:GenericEdge configuration="com.yworks.edge.framed">
  350. <xsl:comment>mod:<xsl:value-of select="$pos mod 10"/>/<xsl:value-of select=" position() mod 10"/> /<xsl:value-of select=" position() mod 2"/> </xsl:comment>
  351. <y:LineStyle width="{(position() mod 3) + 1}.0">
  352. <!--<xsl:attribute name="color" select="$colors/colors/object_hex[ @name = substring-before(@fid,'.') or @name='*' ][1]/text()" xpath-default-namespace=""/>-->
  353. <xsl:attribute name="color" select="'#669900'" />
  354. <!--<xsl:attribute name="type" select="$colors/colors/dashed/dash[ @pos = ( $pos mod 2 ) ]/text()" xpath-default-namespace=""/>-->
  355. </y:LineStyle>
  356. <y:Arrows source="none" target="standard"/>
  357. <y:EdgeLabel alignment="center" configuration="AutoFlippingLabel" distance="2.0" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" horizontalTextPosition="center" iconTextGap="4" modelName="custom" preferredPlacement="anywhere" ratio="0.5" textColor="#000000" verticalTextPosition="bottom" visible="true"><xsl:value-of select="../relation_from/text()"/><y:LabelModel>
  358. <y:SmartEdgeLabelModel autoRotationEnabled="false" defaultAngle="0.0" defaultDistance="10.0"/>
  359. </y:LabelModel>
  360. <y:ModelParameter>
  361. <y:SmartEdgeLabelModelParameter angle="0.0" distance="30.0" distanceToCenter="true" position="right" ratio="0.5" segment="0"/>
  362. </y:ModelParameter>
  363. <y:PreferredPlacementDescriptor angle="0.0" angleOffsetOnRightSide="0" angleReference="absolute" angleRotationOnRightSide="co" distance="-1.0" frozen="true" placement="anywhere" side="anywhere" sideReference="relative_to_edge_flow"/>
  364. </y:EdgeLabel>
  365. <y:StyleProperties>
  366. <!--<y:Property class="java.awt.Color" name="FramedEdgePainter.fillColor" value="{$colors/colors/color[ @pos = $pos mod 10 ]/text()}"/>-->
  367. <y:Property class="java.awt.Color" name="FramedEdgePainter.fillColor" value="red"/>
  368. </y:StyleProperties>
  369. </y:GenericEdge>
  370. <!--<group>
  371. <xsl:value-of select="concat(name(),'_',ID,$next/concat(name(), '_',ID))"/>
  372. </group>-->
  373. </xsl:element>
  374. </xsl:when>
  375. <xsl:otherwise>
  376. <xsl:message>#284 not found node in xml <xsl:value-of select="@xlink:href"/></xsl:message>
  377. </xsl:otherwise>
  378. </xsl:choose>
  379. </xsl:template>
  380. <xsl:template match="wfs:FeatureCollection" xpath-default-namespace="http://graphml.graphdrawing.org/xmlns">
  381. <graphml
  382. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  383. xmlns="http://graphml.graphdrawing.org/xmlns"
  384. xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
  385. <key id="d0" for="node" yfiles.type="nodegraphics"/>
  386. <key id="d1" for="edge" yfiles.type="edgegraphics"/>
  387. <graph id="G" edgedefault="directed">
  388. <!-- TITLE -->
  389. <xsl:element name="node">
  390. <xsl:attribute name="id">
  391. <xsl:value-of select="'title'"/>
  392. </xsl:attribute>
  393. <data key="d0">
  394. <y:ShapeNode>
  395. <y:Geometry height="50.0" width="600"/>
  396. <y:Fill color="#FFFFAA"/>
  397. <y:BorderStyle color="#000000" type="line" width="1.0"/>
  398. <y:NodeLabel width="600" height="50">&lt;html&gt;&lt;div
  399. style="font-size:100%;color:blue;"&gt;
  400. <xsl:value-of select="$graph_title"/>&lt;br&gt;
  401. <xsl:value-of select="$graph_desc"/><!--&lt;br&gt;-->
  402. &lt;/div&gt;
  403. </y:NodeLabel>
  404. </y:ShapeNode>
  405. </data>
  406. </xsl:element>
  407. <xsl:variable name="gml:featureMember">
  408. <!--<gml:featureMember>-->
  409. <xsl:for-each select="gml:featureMember//*[ substring-before(substring-after(name(),'__x3A__'),':') = local-name() and * ]">
  410. <!--<xsl:message>#135OKOK trasa <xsl:value-of select="position()"/> <xsl:value-of select="@fid"/></xsl:message>-->
  411. <xsl:element name="{local-name()}" >
  412. <!--<xsl:namespace name="{ substring-before(name(),':')}" select="substring-before(name(),':')"/>-->
  413. <xsl:copy-of select="@*"/>
  414. <xsl:attribute name="pos" select="position()"/>
  415. <xsl:if test="../@fid"><xsl:attribute name="parent" select="../@fid"/></xsl:if>
  416. <xsl:for-each select="*[ not( substring-before(substring-after(name(),'__x3A__'),':') = local-name() ) ]">
  417. <xsl:copy-of select="." copy-namespaces="no"/>
  418. </xsl:for-each>
  419. </xsl:element>
  420. </xsl:for-each>
  421. <!--</gml:featureMember>-->
  422. </xsl:variable>
  423. <!--<debug.128>
  424. <xsl:copy-of select="$gml:featureMember"/>
  425. </debug.128>-->
  426. <!--<debug_129_grouped>
  427. <xsl:for-each-group select="$gml:featureMember/*" group-by="@fid">
  428. <xsl:copy-of select="."/>
  429. </xsl:for-each-group>
  430. </debug_129_grouped>-->
  431. <xsl:comment>#95 create-nodes-BI dla DEALS</xsl:comment>
  432. <xsl:comment>#139 nizej group by</xsl:comment>
  433. <xsl:for-each-group select="$gml:featureMember/*" group-by="@fid">
  434. <xsl:comment>#142 create-nodes-BI-wfs for @fid=<xsl:value-of select="@fid"/>;</xsl:comment>
  435. <xsl:apply-templates mode="create-nodes-BI-wfs" select="." />
  436. </xsl:for-each-group>
  437. <xsl:variable name="edges">
  438. <edges>
  439. <xsl:for-each select="$gml:featureMember/*">
  440. <xsl:comment>#149 parent <xsl:value-of select="@parent"/> fid <xsl:value-of select="@fid"/> name=<xsl:value-of select="name()"/></xsl:comment>
  441. <!--<xsl:message>#149 parent <xsl:value-of select="@parent"/> fid <xsl:value-of select="@fid"/> name=<xsl:value-of select="name()"/></xsl:message>-->
  442. <xsl:apply-templates mode="create-edges-BI-wfs" select="." >
  443. <xsl:with-param name="pos" select="@pos"/>
  444. <xsl:with-param name="next" select="@parent"/>
  445. </xsl:apply-templates>
  446. </xsl:for-each>
  447. </edges>
  448. </xsl:variable>
  449. <xsl:for-each-group select="$edges/edges/edge" group-by="concat(@target,@source)"> <!-- group-by="@target" -->
  450. <edge xmlns="http://graphml.graphdrawing.org/xmlns">
  451. <xsl:copy-of select="@*"/>
  452. <!--<xsl:copy-of select="../comment()"/>-->
  453. <!--<xsl:comment>#173</xsl:comment>-->
  454. <!--<xsl:copy-of select="../../comment()"/>-->
  455. <xsl:copy-of select="*"/>
  456. </edge>
  457. </xsl:for-each-group>
  458. </graph>
  459. </graphml>
  460. </xsl:template>
  461. </xsl:stylesheet>