graph.xsl 36 KB

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