graph.xsl 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  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="@*" mode="graph:graph.graph-to-analyze.xml.child">
  308. <xsl:copy-of select="."/>
  309. </xsl:template>
  310. <xsl:template mode="graph:graph.graph-to-nodes.xml" match="graph:graph.graph-to-analyze.xml">
  311. <graph.graph-to-nodes.xml>
  312. <xsl:for-each-group select="*" group-by="@fid">
  313. <xsl:comment>#142 create-nodes-BI-wfs for @fid=<xsl:value-of select="@fid"/>;</xsl:comment>
  314. <xsl:apply-templates mode="graph:create-nodes" select="." />
  315. </xsl:for-each-group>
  316. <xsl:for-each-group select="*" group-by="@fid">
  317. <xsl:comment>#142 create-nodes-BI-wfs for @fid=<xsl:value-of select="@fid"/>;</xsl:comment>
  318. <xsl:apply-templates mode="graph:create-edges" select="." />
  319. </xsl:for-each-group>
  320. </graph.graph-to-nodes.xml>
  321. </xsl:template>
  322. <xsl:template match="*" mode="graph:create-nodes" >
  323. <xsl:element name="node" namespace="http://graphml.graphdrawing.org/xmlns">
  324. <xsl:attribute name="id">
  325. <!--<xsl:value-of select="concat(name(),'_',@pos)"/>-->
  326. <xsl:value-of select="replace(@fid,'\.','_')"/>
  327. </xsl:attribute>
  328. <!--<xsl:attribute name="deb.fid" select="@fid"/>-->
  329. <!--<xsl:attribute name="deb.fid2" select=" text()"/>-->
  330. <data key="d0" xmlns="http://graphml.graphdrawing.org/xmlns">
  331. <y:ShapeNode>
  332. <!--<y:Geometry height="{ ((count(*[not( local-name()='ID') and not( matches(local-name(),'(S_*)|(A_)|(TERYT.*)'))]) * 18) + 70)}" width="600"/>--><!-- { count(*) * 10} -->
  333. <!--<y:Fill color="#CCCCCC"/>-->
  334. <y:Geometry height="100" width="600"/>
  335. <y:Fill transparent="false">
  336. <xsl:attribute name="color">
  337. <!--<xsl:value-of select="$colors/colors/object_hex[ @name = current()/local-name() or @name='*'][1]/text()" xpath-default-namespace=""/>-->
  338. <xsl:value-of select="'#666666'" xpath-default-namespace=""/>
  339. </xsl:attribute>
  340. </y:Fill><!--<xsl:value-of select="local-name()"/>-->
  341. <!--<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
  342. style="font-size:120%;color:black;"&gt;
  343. <xsl:value-of select="ID"/>&lt;br&gt;
  344. <xsl:value-of select=" substring(name(),10)"/>&lt;br&gt;
  345. <xsl:for-each select="*[not( local-name()='ID') and not( matches(local-name(),'(S_*)|(A_)|(TERYT.*)'))]" xpath-default-namespace="http://graphml.graphdrawing.org/xmlns">
  346. <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;
  347. </xsl:for-each>
  348. &lt;/div&gt;
  349. </y:NodeLabel>-->
  350. <y:NodeLabel width="400" height="100">&lt;html&gt;&lt;div
  351. style="font-size:120%;color:black;"&gt;
  352. <xsl:value-of select="ID"/>&lt;br&gt;
  353. <xsl:value-of select=" substring(name(),10)"/>&lt;br&gt;
  354. <xsl:for-each select="*[not( local-name()='ID') and not( matches(local-name(),'(S_*)|(A_)|(TERYT.*)'))]" xpath-default-namespace="http://graphml.graphdrawing.org/xmlns">
  355. <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;
  356. </xsl:for-each>
  357. &lt;/div&gt;
  358. </y:NodeLabel>
  359. </y:ShapeNode>
  360. </data>
  361. </xsl:element>
  362. </xsl:template>
  363. <xsl:template match="*[@fid]" mode="graph:create-edges" priority="5" >
  364. <!--<default_db__x3A__BI_audit_KRS_person:BI_audit_KRS_person
  365. xlink:href="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS_person#BI_audit_KRS_person.150746"/>-->
  366. <!-- <xsl:param name="pos" required="yes"/>
  367. <xsl:param name="next" required="yes"/>-->
  368. <xsl:comment>#273parent <xsl:value-of select="@parent"/></xsl:comment>
  369. <xsl:choose>
  370. <xsl:when test="@fid">
  371. <xsl:element name="edge" namespace="http://graphml.graphdrawing.org/xmlns">
  372. <!--<xsl:attribute name="debug.279" select="1"/>-->
  373. <xsl:attribute name="id">
  374. <xsl:value-of select="generate-id()"/>
  375. </xsl:attribute>
  376. <xsl:attribute name="source">
  377. <!--<xsl:value-of select="concat(name(),'_',@pos)"/>-->
  378. <xsl:value-of select="replace(@fid,'\.','_')"/>
  379. </xsl:attribute>
  380. <xsl:attribute name="target">
  381. <!--<xsl:value-of select="$next[1]/concat(name(), '_',@pos)"/>-->
  382. <xsl:value-of select="replace(@fid.parent,'\.','_')"/>
  383. </xsl:attribute>
  384. <!--<xsl:attribute name="deb.ref" select="../*[@fid = current()/substring-after(@xlink:href,'#')]"/>-->
  385. <y:GenericEdge configuration="com.yworks.edge.framed">
  386. <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>
  387. <y:LineStyle width="{(position() mod 3) + 1}.0">
  388. <!--<xsl:attribute name="color" select="$colors/colors/object_hex[ @name = substring-before(@fid,'.') or @name='*' ][1]/text()" xpath-default-namespace=""/>-->
  389. <xsl:attribute name="color" select="'#669900'" />
  390. <!--<xsl:attribute name="type" select="$colors/colors/dashed/dash[ @pos = ( $pos mod 2 ) ]/text()" xpath-default-namespace=""/>-->
  391. </y:LineStyle>
  392. <y:Arrows source="none" target="standard"/>
  393. <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>
  394. <y:SmartEdgeLabelModel autoRotationEnabled="false" defaultAngle="0.0" defaultDistance="10.0"/>
  395. </y:LabelModel>
  396. <y:ModelParameter>
  397. <y:SmartEdgeLabelModelParameter angle="0.0" distance="30.0" distanceToCenter="true" position="right" ratio="0.5" segment="0"/>
  398. </y:ModelParameter>
  399. <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"/>
  400. </y:EdgeLabel>
  401. <y:StyleProperties>
  402. <!--<y:Property class="java.awt.Color" name="FramedEdgePainter.fillColor" value="{$colors/colors/color[ @pos = $pos mod 10 ]/text()}"/>-->
  403. <y:Property class="java.awt.Color" name="FramedEdgePainter.fillColor" value="red"/>
  404. </y:StyleProperties>
  405. </y:GenericEdge>
  406. <!--<group>
  407. <xsl:value-of select="concat(name(),'_',ID,$next/concat(name(), '_',ID))"/>
  408. </group>-->
  409. </xsl:element>
  410. </xsl:when>
  411. <xsl:otherwise>
  412. <xsl:message>#284 not found node in xml <xsl:value-of select="@xlink:href"/></xsl:message>
  413. </xsl:otherwise>
  414. </xsl:choose>
  415. </xsl:template>
  416. <xsl:template match="wfs:FeatureCollection" xpath-default-namespace="http://graphml.graphdrawing.org/xmlns">
  417. <graphml
  418. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  419. xmlns="http://graphml.graphdrawing.org/xmlns"
  420. xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
  421. <key id="d0" for="node" yfiles.type="nodegraphics"/>
  422. <key id="d1" for="edge" yfiles.type="edgegraphics"/>
  423. <graph id="G" edgedefault="directed">
  424. <!-- TITLE -->
  425. <xsl:element name="node">
  426. <xsl:attribute name="id">
  427. <xsl:value-of select="'title'"/>
  428. </xsl:attribute>
  429. <data key="d0">
  430. <y:ShapeNode>
  431. <y:Geometry height="50.0" width="600"/>
  432. <y:Fill color="#FFFFAA"/>
  433. <y:BorderStyle color="#000000" type="line" width="1.0"/>
  434. <y:NodeLabel width="600" height="50">&lt;html&gt;&lt;div
  435. style="font-size:100%;color:blue;"&gt;
  436. <xsl:value-of select="$graph_title"/>&lt;br&gt;
  437. <xsl:value-of select="$graph_desc"/><!--&lt;br&gt;-->
  438. &lt;/div&gt;
  439. </y:NodeLabel>
  440. </y:ShapeNode>
  441. </data>
  442. </xsl:element>
  443. <xsl:variable name="gml:featureMember">
  444. <!--<gml:featureMember>-->
  445. <xsl:for-each select="gml:featureMember//*[ substring-before(substring-after(name(),'__x3A__'),':') = local-name() and * ]">
  446. <!--<xsl:message>#135OKOK trasa <xsl:value-of select="position()"/> <xsl:value-of select="@fid"/></xsl:message>-->
  447. <xsl:element name="{local-name()}" >
  448. <!--<xsl:namespace name="{ substring-before(name(),':')}" select="substring-before(name(),':')"/>-->
  449. <xsl:copy-of select="@*"/>
  450. <xsl:attribute name="pos" select="position()"/>
  451. <xsl:if test="../@fid"><xsl:attribute name="parent" select="../@fid"/></xsl:if>
  452. <xsl:for-each select="*[ not( substring-before(substring-after(name(),'__x3A__'),':') = local-name() ) ]">
  453. <xsl:copy-of select="." copy-namespaces="no"/>
  454. </xsl:for-each>
  455. </xsl:element>
  456. </xsl:for-each>
  457. <!--</gml:featureMember>-->
  458. </xsl:variable>
  459. <!--<debug.128>
  460. <xsl:copy-of select="$gml:featureMember"/>
  461. </debug.128>-->
  462. <!--<debug_129_grouped>
  463. <xsl:for-each-group select="$gml:featureMember/*" group-by="@fid">
  464. <xsl:copy-of select="."/>
  465. </xsl:for-each-group>
  466. </debug_129_grouped>-->
  467. <xsl:comment>#95 create-nodes-BI dla DEALS</xsl:comment>
  468. <xsl:comment>#139 nizej group by</xsl:comment>
  469. <xsl:for-each-group select="$gml:featureMember/*" group-by="@fid">
  470. <xsl:comment>#142 create-nodes-BI-wfs for @fid=<xsl:value-of select="@fid"/>;</xsl:comment>
  471. <xsl:apply-templates mode="create-nodes-BI-wfs" select="." />
  472. </xsl:for-each-group>
  473. <xsl:variable name="edges">
  474. <edges>
  475. <xsl:for-each select="$gml:featureMember/*">
  476. <xsl:comment>#149 parent <xsl:value-of select="@parent"/> fid <xsl:value-of select="@fid"/> name=<xsl:value-of select="name()"/></xsl:comment>
  477. <!--<xsl:message>#149 parent <xsl:value-of select="@parent"/> fid <xsl:value-of select="@fid"/> name=<xsl:value-of select="name()"/></xsl:message>-->
  478. <xsl:apply-templates mode="create-edges-BI-wfs" select="." >
  479. <xsl:with-param name="pos" select="@pos"/>
  480. <xsl:with-param name="next" select="@parent"/>
  481. </xsl:apply-templates>
  482. </xsl:for-each>
  483. </edges>
  484. </xsl:variable>
  485. <xsl:for-each-group select="$edges/edges/edge" group-by="concat(@target,@source)"> <!-- group-by="@target" -->
  486. <edge xmlns="http://graphml.graphdrawing.org/xmlns">
  487. <xsl:copy-of select="@*"/>
  488. <!--<xsl:copy-of select="../comment()"/>-->
  489. <!--<xsl:comment>#173</xsl:comment>-->
  490. <!--<xsl:copy-of select="../../comment()"/>-->
  491. <xsl:copy-of select="*"/>
  492. </edge>
  493. </xsl:for-each-group>
  494. </graph>
  495. </graphml>
  496. </xsl:template>
  497. </xsl:stylesheet>