| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- exclude-result-prefixes="xs"
- xmlns:grapht="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/graph_tree/graph_tree.xsd"
- xmlns:get_wfs_recurse_xsl="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/get_wfs_recurse_xsl.xsd"
- xmlns:y="http://www.yworks.com/xml/graphml"
- xmlns:wfs="http://www.opengis.net/wfs"
- xmlns:gml="http://www.opengis.net/gml"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:p5="https://biuro.biall-net.pl/wfs"
- version="2.0">
-
- <xsl:output indent="yes"/>
- <xsl:strip-space elements="*"/>
-
- <xsl:template match="get_wfs_recurse_xsl:context.PRIMARYKEY|get_wfs_recurse_xsl:nodes" mode="#all"/>
-
-
- <!--
-
- a.binder Metody optumalizacji wizualizacji danych do weryfikacji czy są gotowe funckje/biblioteki do tego
-
- 1) NearestMiddleShortcut
- A - B - C => A - - - C
-
- 2) MiddlePathShortcut
- A - B - C - D => A - - - D
-
- 3) MiddleGroup
- - C1 - D1 / - D1
- A - B + => A [B: C1,C2 ] -
- - C2 - D2 \ - D2
-
-
- 4) CutPath
- A - B - C - D => C - D
-
-
- 5) TypesGroup
-
- A1 - B1 - C1
- A2 - B2 - C2 => [ A1, A2, A3 ] = [ B1, B2, B3 ] = [ C1, C2, C3 ]
- A3 - B3 - C3
-
-
- 6) TypesAndFlowsGroup
- [ ] - - - - - - [ ]
- A1 - B1 - C1 [ A1 ] [ B1 ]- - [ C1 ]
- C2 - B2 - A2 => [ B2 ]- - [ A2 ] [ C3 ]
- B3 - A3 - C3 [ B3 ] [ A3 ]
-
-
-
-
- mixing this types also
-
-
-
-
- -->
-
-
- <xsl:function name="wfs:primary_key">
- <xsl:param name="xlink:href"/>
- <xsl:variable name="tokens" select="count(tokenize($xlink:href,'\.'))"/>
- <xsl:value-of select="tokenize($xlink:href,'\.')[$tokens]"/>
- </xsl:function>
-
-
-
- <xsl:function name="wfs:namespace">
- <xsl:param name="xlink:href"/>
- <xsl:value-of select=" substring-before($xlink:href,'#')"/>
- </xsl:function>
-
-
-
-
- <xsl:function name="wfs:element">
- <xsl:param name="xlink:href"/>
- <xsl:variable name="element_w_fid" select="substring-after($xlink:href,'#')"/>
- <xsl:value-of select="substring-before($element_w_fid,'.')"/>
- </xsl:function>
-
-
- <xsl:function name="wfs:fid">
- <xsl:param name="xlink:href"/>
- <xsl:value-of select="concat( wfs:element($xlink:href),'.', wfs:primary_key($xlink:href))"/>
- </xsl:function>
-
- <xsl:template match="wfs:FeatureCollection" mode="grapht:analyze_nodes">
- <grapht:analyze_nodes>
- <xsl:for-each-group select=".//*[*|@xlink:href]" group-by="name()">
- <xsl:copy copy-namespaces="no">
- <xsl:attribute name="grapht:count" select="count(current-group())"/>
- <xsl:attribute name="grapht:count.xlink" select="count(current-group()[@xlink:href])"/>
- <grapht:analyze_nodes.xlink.rebuild_tree_inputs>
- <xsl:for-each select=" current-group()[@xlink:href]" > <!-- -group group-by="@fid" -->
- <xsl:sort select="count(ancestor::node())"/>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:variable name="grapht.fid" select="wfs:fid(@xlink:href)"/>
- <xsl:attribute name="grapht.fid" select="$grapht.fid"/>
- <xsl:attribute name="grapht:ancestor.count" select="count(ancestor::node())"/>
- <xsl:apply-templates mode="grapht:analyze_nodes.xlink.rebuild_tree" select="root()//*[*[@fid= $grapht.fid ]]"> <!-- and * -->
- <xsl:with-param name="fid" select="$grapht.fid"/>
- <xsl:with-param name="root.node" select="root()"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:for-each>
- </grapht:analyze_nodes.xlink.rebuild_tree_inputs>
- </xsl:copy>
- </xsl:for-each-group>
- </grapht:analyze_nodes>
- </xsl:template>
-
-
- <xsl:template match="*" mode="grapht:analyze_nodes.xlink.rebuild_tree">
- <xsl:param name="fid" required="yes"/>
- <xsl:param name="root.node" required="yes"/>
- <xsl:copy copy-namespaces="no">
- <!--<xsl:element name="{../name()}">-->
- <xsl:copy-of select="@*"/>
-
- <!--</xsl:element>-->
- </xsl:copy>
- </xsl:template>
-
-
- </xsl:stylesheet>
|