| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496 |
- <?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"
- xmlns:default_db__x3A__BI_audit_ENERGA_PRACOWNICY="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_PRACOWNICY"
- xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI"
- xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row"
- xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object"
- xmlns:default_db__x3A__BI_audit_taxpayer="https://biuro.biall-net.pl/wfs/default_db/BI_audit_taxpayer"
- xmlns:default_db__x3A__TERYT_adresy="https://biuro.biall-net.pl/wfs/default_db/TERYT_adresy"
- xmlns:default_db__x3A__BI_audit_KRS="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS"
- xmlns:default_db__x3A__BI_audit_KRS_person="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS_person"
- xmlns:default_db__x3A__BI_audit_KRS_company="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS_company"
- xmlns:default_db__x3A__BI_audit_MSIG="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG"
- xmlns:default_db__x3A__BI_audit_MSIG_person="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_person"
- xmlns:default_db__x3A__BI_audit_MSIG_company="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_company"
- xmlns:default_db__x3A__BI_audit_MSIG_name="https://biuro.biall-net.pl/wfs/default_db/BI_audit_MSIG_name"
- xmlns:default_db__x3A__BI_audit_ENERGA_PRACOWNICY_adresy="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_PRACOWNICY_adresy"
- xmlns:xp5r="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/xinclude_p5_recurse/xinclude_p5_recurse.xsd"
- 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"/>-->
- <xsl:param name="grapht.temp"/>
- <xsl:param name="debug.filter" select="'(9177)|(9177)'"/>
- <xsl:param name="grapht.xsl.testing"/>
- <xsl:param name="grapht.testing.analyze_nodes.grapht.fid.xml"/>
-
-
- <!-- zalozenia
- grapht:analyze_fid
- grapht:analyze_nodes.tree fid="BI_audit_KRS_person.150746"
- grapht:analyze_nodes.tree.clousure.searched
- search there for range limit - 5? ???
- <grapht:path_to grapht:fid="BI_audit_ENERGA_PRACOWNICY_adresy.11"
- grapht:path="2"
- grapht:node_from="BI_audit_ENERGA_PRACOWNICY.9"/>
-
- -->
-
-
- <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:if test="string-length($xlink:href) >0">
- <xsl:value-of select="concat( wfs:element($xlink:href),'.', wfs:primary_key($xlink:href))"/>
- </xsl:if>
- </xsl:function>
-
- <xsl:template match="@fid" mode="grapht:fid">
- <xsl:attribute name="grapht:fid" select="."/>
- </xsl:template>
- <xsl:template match="@xlink:href" mode="grapht:fid">
- <xsl:attribute name="grapht:fid" select="wfs:fid(.)"/>
- </xsl:template>
-
- <xsl:template match="@*" mode="grapht:fid"/>
-
-
-
- <xsl:template match="wfs:FeatureCollection" mode="grapht:analyze_nodes">
- <grapht:analyze_nodes>
- <xsl:for-each-group select=".//*[(*|@xlink:href) and not(name()='gml:featureMember')]" 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])"/>
- <xp5r:cache xmlns:xp5r="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/xinclude_p5_recurse/xinclude_p5_recurse.xsd"
- xp5r:id="{local-name()}"
- xp5r:basedir="{$grapht.temp}"
- xp5r:stylesheet="{$grapht.xsl.testing}">
- <xp5r:namespace namespace="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/graph_tree/graph_tree.xsd" name="grapht"/>
- <xp5r:namespace namespace="http://www.opengis.net/wfs" name="wfs"/>
- <xp5r:namespace namespace="http://www.opengis.net/gml" name="gml"/>
- <xp5r:namespace namespace="http://www.w3.org/1999/xlink" name="xlink"/>
- <xp5r:param name="debug.filter" value="{$debug.filter}"/>
- <xp5r:apply-template mode="grapht:analyze_nodes.xp5r" select=".">
- <xp5r:context-node>
- <xp5r:for-each-group
- select="doc('{$grapht.testing.analyze_nodes.grapht.fid.xml}')/wfs:FeatureCollection//*[(*|@xlink:href) and not(name()='gml:featureMember') and name()='{name()}']"
- group-by="name()"/>
- </xp5r:context-node>
- <!--<xsl:apply-templates mode="grapht:analyze_nodes.xp5r" select="."/>-->
- </xp5r:apply-template>
- </xp5r:cache>
- </xsl:copy>
- </xsl:for-each-group>
- </grapht:analyze_nodes>
- </xsl:template>
-
-
-
- <xsl:template match="*" mode="grapht:analyze_nodes.xp5r">
- <grapht:analyze_fid><!-- for name grouped -->
- <!--<debug.copy>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <current.group>
- <xsl:copy-of select="current-group()"/>
- </current.group>
- <current.root>
- <xsl:copy-of select="root()"/>
- </current.root>
- </xsl:copy>
- </debug.copy>-->
- <!--<xsl:for-each-group select="current-group()[ matches(@p5:primaryKey,$debug.filter) ]" group-by="@fid">-->
- <xsl:for-each select="current-group()[ count(descendant::*[* |@xlink:href]) >0 and matches(@p5:primaryKey,$debug.filter) ]"> <!-- FILTER -->
- <xsl:message>#136 maching @fid=<xsl:value-of select="@fid"/>; for matches(@p5:primaryKey=<xsl:value-of select="@p5:primaryKey"/>,$debug.filter=<xsl:value-of select="$debug.filter"/>) </xsl:message>
- <grapht:analyze_nodes.tree>
- <xsl:attribute name="fid" select="@fid"/>
- <xsl:attribute name="p5:primaryKey" select="@p5:primaryKey"/>
- <xsl:attribute name="xlink:href" select="@xlink:href"/>
- <xsl:attribute name="grapht:pos" select="position()"/>
- <xsl:variable name="grapht:anchestor.count" select=" count(ancestor::*)"/>
- <xsl:attribute name="grapht:anchestor.count" select="$grapht:anchestor.count"/>
- <xsl:variable name="grapht:childs.count" select="count(descendant::*[* |@xlink:href])"/>
- <xsl:attribute name="grapht:childs.count" select="$grapht:childs.count"/>
- <xsl:variable name="grapht:last_child.fid" select="descendant::*[ * | @xlink:href][$grapht:childs.count]/concat(@fid,wfs:fid(@xlink:href))"/>
- <xsl:attribute name="grapht:last_child.fid" select="$grapht:last_child.fid"/>
- <!--<xsl:attribute name="grapht:root.fid" select=" ancestor::*[@fid][1]/@fid"/>-->
- <xsl:apply-templates mode="grapht:fid" select="@*"/>
- <!--<xsl:copy copy-namespaces="no">-->
- <!--<xsl:attribute name="fid" select="@fid"/>-->
- <!--<grapht:analyze_nodes.tree.childs>
- <xsl:attribute name="grapht:parent.childs.count" select="$grapht:childs.count"/>
- <xsl:attribute name="grapht:parent.ancestor.count" select="count( ancestor::*)"/>
- <!-\-<xsl:apply-templates mode="grapht:analyze_nodes.tree.childs" select="descendant::*[*|@xlink:href]">
- <xsl:with-param name="grapht:parent.childs.count" select="$grapht:childs.count"/>
- <xsl:with-param name="grapht:parent.ancestor.count" select="count(ancestor::*)"/>
- <xsl:with-param name="grapht:last_child.fid" select="$grapht:last_child.fid"/>
- </xsl:apply-templates>-\->
- <!-\-<xsl:for-each-group select="descendant::*[*|@xlink:href]" group-by="concat(@fid,wfs:fid(@xlink:href))">
- <xsl:apply-templates mode="grapht:analyze_nodes.tree.childs" select=".">
- <xsl:with-param name="grapht:parent.childs.count" select="$grapht:childs.count"/>
- <xsl:with-param name="grapht:parent.ancestor.count" select="count(ancestor::*)"/>
- <xsl:with-param name="grapht:last_child.fid" select="$grapht:last_child.fid"/>
- </xsl:apply-templates>
- </xsl:for-each-group>-\->
- </grapht:analyze_nodes.tree.childs>-->
- <!--<grapht:analyze_nodes.xlink.rebuild_tree_inputs>
- <xsl:attribute name="debug">#147 temporary disabled</xsl:attribute>
- <!-\-<xsl:for-each select=" current-group()[@xlink:href and matches(@p5:primaryKey,$debug.filter) ]" > <!-\\- -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>-->
-
- <grapht:analyze_nodes.tree.clousure.searched>
- <xsl:variable name="current.parent.fid" select="@grapht:fid"/>
-
- <xsl:for-each select="root()//*[ not(@grapht:fid = $current.parent.fid) and (* or @xlink:href or @fid) and ( matches(@p5:primaryKey,$debug.filter) )]"> <!-- or matches($current.parent.fid,$debug.filter) FILTER -->
- <!--<xsl:message>#280 searching path from <xsl:value-of select="$current.parent.fid"/> to <xsl:value-of select="concat(@fid,wfs:fid(@xlink:href))"/></xsl:message>-->
- <grapht:path_to>
- <xsl:attribute name="grapht:fid" select="@grapht:fid"/>
- <xsl:choose>
- <xsl:when test="ancestor::*[@grapht:fid=$current.parent.fid ]">
- <!--<xsl:message>#285 parent path found for <xsl:value-of select="$current.parent.fid"/> </xsl:message>-->
- <xsl:variable name="curr.ancerstor.count" select="count(ancestor::*)"/>
- <xsl:variable name="parent.ancerstor.count" select="ancestor::*[@grapht:fid=$current.parent.fid][1]/count(ancestor::*)"/>
- <xsl:attribute name="curr.ancerstor.count" select="$curr.ancerstor.count"/>
- <xsl:attribute name="parent.ancerstor.count" select="$parent.ancerstor.count"/>
- <xsl:attribute name="grapht:path" select="$curr.ancerstor.count - $parent.ancerstor.count"/>
- <xsl:attribute name="grapht:node_from" select="@grapht:fid"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="grapht:analyze_nodes.tree.clousure.searched" select="." >
- <xsl:with-param name="current.parent.fid" select="$current.parent.fid"/>
- <xsl:with-param name="grapht:fid" select="@grapht:fid"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </grapht:path_to>
- </xsl:for-each>
- </grapht:analyze_nodes.tree.clousure.searched>
- </grapht:analyze_nodes.tree>
- </xsl:for-each>
- <!--</xsl:for-each-group>-->
- </grapht:analyze_fid>
- </xsl:template>
-
-
-
- <xsl:template match="*" mode="grapht:analyze_nodes.tree.childs">
- <xsl:param name="grapht:parent.childs.count" required="yes"/>
- <xsl:param name="grapht:parent.ancestor.count" required="yes"/>
- <xsl:param name="grapht:last_child.fid" required="yes"/>
- <xsl:variable name="grapht:childs.count" select="count(descendant::*[* |@xlink:href])"/>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="grapht:last_child.fid" select="descendant::*[ * | @xlink:href][$grapht:childs.count]/concat(@fid,wfs:fid(@xlink:href))"/>
- <xsl:apply-templates mode="grapht:fid" select="@*"/>
- <xsl:attribute name="grapht:ancestor.count" select="count(ancestor::*)"/>
- <xsl:attribute name="grapht:childs.count" select="$grapht:childs.count"/>
- <xsl:attribute name="grapht:parent.ancestor.count" select="$grapht:parent.ancestor.count"/>
- <xsl:attribute name="grapht:ancestor.path.len" select="count(ancestor::*) - $grapht:parent.ancestor.count"/>
- <xsl:attribute name="grapht:last_child.fid" select="$grapht:last_child.fid"/>
- </xsl:copy>
- </xsl:template>
-
-
- <xsl:template match="*[not(@fid or @xlink:href)]" mode="grapht:analyze_nodes.tree.childs"/>
-
-
-
- <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:apply-templates mode="grapht:fid" select="@*"/>
- <!--</xsl:element>-->
- </xsl:copy>
- </xsl:template>
-
- <!-- todo unique grapht:analyze_nodes.tree.ancestors -->
-
-
- <xsl:template match="grapht:analyze_nodes" mode="grapht:analyze_nodes.paths">
- <grapht:analyze_nodes.paths>
- <xsl:apply-templates mode="grapht:analyze_nodes.paths"/>
- </grapht:analyze_nodes.paths>
- </xsl:template>
-
- <xsl:template match="*" mode="grapht:analyze_nodes.paths">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="grapht:fid" select="@*"/>
- <xsl:apply-templates mode="grapht:analyze_nodes.paths"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="gml:featureMember" mode="grapht:analyze_nodes.paths grapht:analyze_nodes.paths.unique"/>
-
-
-
- <xsl:template match="grapht:analyze_fid" mode="grapht:analyze_nodes.paths">
- <!-- szukam unkalnych parentow jakie mam, z najkrotsza sciezka
- , a potem szukam dla nich jakie oni maja dzieci unikalne, najkrotsze sciezki
- -->
- <xsl:message>#217 running grapht:analyze_nodes.paths with debug.filter=<xsl:value-of select="$debug.filter"/></xsl:message>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:for-each select="grapht:analyze_nodes.tree" > <!-- group-by="@fid" -->
- <xsl:message>#221 foreach grapht:analyze_nodes.tree @grapht:fid=<xsl:value-of select="@grapht:fid"/>; @grapht:pos=<xsl:value-of select="@grapht:pos"/>; group-by="@fid"=<xsl:value-of select="@fid"/>; @p5:primaryKey=<xsl:value-of select="@p5:primaryKey"/>; </xsl:message>
- <xsl:variable name="current.parent.fid" select="@grapht:fid"/>
- <xsl:variable name="current.parent.pos" select="@grapht:pos"/>
- <xsl:variable name="grapht:last_child.fid" select="@grapht:last_child.fid"/>
- <xsl:variable name="grapht:anchestor.count" select="@grapht:anchestor.count"/>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <grapht:analyze_nodes.tree.clousure>
- <!--<xsl:attribute name="debug.288"> looking for @grapht:last_child.fid=$grapht:last_child.fid = <xsl:value-of select="$grapht:last_child.fid"/> ] </xsl:attribute>-->
- <xsl:for-each select="root()//grapht:analyze_nodes.tree[not(@grapht:fid = $current.parent.fid) and @grapht:last_child.fid=$grapht:last_child.fid and ( matches(@p5:primaryKey,$debug.filter) or matches($current.parent.fid,$debug.filter) ) ]"> <!-- FILTER -->
- <grapht:path>
- <xsl:attribute name="grapht:path.len" select="$grapht:anchestor.count - number(@grapht:anchestor.count) "/>
- <xsl:attribute name="grapht:fid" select="@grapht:fid"/>
- <xsl:copy-of select="@*"/>
- </grapht:path>
- </xsl:for-each>
- </grapht:analyze_nodes.tree.clousure>
- </xsl:copy>
- </xsl:for-each>
- </xsl:copy>
- </xsl:template>
-
- <!--<xsl:template match="grapht:analyze_fid" mode="grapht:analyze_nodes.paths">
- <!-\- szukam unkalnych parentow jakie mam, z najkrotsza sciezka
- , a potem szukam dla nich jakie oni maja dzieci unikalne, najkrotsze sciezki
- -\->
- <xsl:message>#217 running grapht:analyze_nodes.paths with debug.filter=<xsl:value-of select="$debug.filter"/></xsl:message>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:for-each select="grapht:analyze_nodes.tree" > <!-\- group-by="@fid" -\->
- <xsl:message>#221 foreach grapht:analyze_nodes.tree @grapht:fid=<xsl:value-of select="@grapht:fid"/>; @grapht:pos=<xsl:value-of select="@grapht:pos"/>; group-by="@fid"=<xsl:value-of select="@fid"/>; @p5:primaryKey=<xsl:value-of select="@p5:primaryKey"/>; </xsl:message>
- <xsl:variable name="current.parent.fid" select="@grapht:fid"/>
- <xsl:variable name="current.parent.pos" select="@grapht:pos"/>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <grapht:analyze_nodes.tree.ancestors>
- <xsl:for-each select="grapht:analyze_nodes.tree.childs/*[ matches(@p5:primaryKey,$debug.filter) ]" ><!-\-group-by="@fid" FILTERING -\->
- <xsl:sort select="@grapht:fid"/>
- <xsl:variable name="current.analyze_nodes.tree.ancestors.fid" select="@grapht:fid"/>
- <!-\-<xsl:variable name="current.analyze_nodes.tree.ancestors.pos" select="@grapht:pos"/>-\->
- <xsl:message>#245 current.analyze_nodes.tree.ancestors.fid=<xsl:value-of select="@grapht:fid"/>; <!-\-@grapht:pos=<xsl:value-of select="@grapht:pos"/>;-\-></xsl:message>
- <!-\- grapht:ancestor.path.len -\->
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <grapht:analyze_nodes.tree.childs.paths.to_childs>
- <!-\- <xsl:for-each select="current-group()">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>-\->
- <grapht:analyze_nodes.tree.childs.paths.to_childs.childs>
- <xsl:attribute name="debug">#223 dla znalezionych ojcow, szukam innych dzieci </xsl:attribute>
- <xsl:for-each select="root()//grapht:analyze_fid/grapht:analyze_nodes.tree[not(@grapht:fid=$current.parent.fid)]/grapht:analyze_nodes.tree.childs/*[@grapht:fid = $current.analyze_nodes.tree.ancestors.fid and matches(@p5:primaryKey,$debug.filter)]"> <!-\- FILTER -\->
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <!-\-<xsl:for-each select="ancestor::*">
- <ancestor>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- </xsl:copy>
- </ancestor>
- </xsl:for-each>-\->
- </xsl:copy>
- </xsl:for-each>
- </grapht:analyze_nodes.tree.childs.paths.to_childs.childs>
- <!-\-</xsl:copy>
- </xsl:for-each>-\->
- </grapht:analyze_nodes.tree.childs.paths.to_childs>
- </xsl:copy>
- </xsl:for-each>
- </grapht:analyze_nodes.tree.ancestors>
- </xsl:copy>
- </xsl:for-each>
- </xsl:copy>
- </xsl:template>-->
-
- <!--<xsl:template match="grapht:analyze_fid" mode="grapht:analyze_nodes.paths">
- <!-\- szukam unkalnych parentow jakie mam, z najkrotsza sciezka
- , a potem szukam dla nich jakie oni maja dzieci unikalne, najkrotsze sciezki
- -\->
- <xsl:message>#217 running grapht:analyze_nodes.paths with debug.filter=<xsl:value-of select="$debug.filter"/></xsl:message>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:for-each select="grapht:analyze_nodes.tree" > <!-\- group-by="@fid" -\->
- <xsl:message>#221 foreach grapht:analyze_nodes.tree @grapht:fid=<xsl:value-of select="@grapht:fid"/>; @grapht:pos=<xsl:value-of select="@grapht:pos"/>; group-by="@fid"=<xsl:value-of select="@fid"/>; @p5:primaryKey=<xsl:value-of select="@p5:primaryKey"/>; </xsl:message>
- <xsl:variable name="current.parent.fid" select="@grapht:fid"/>
- <xsl:variable name="current.parent.pos" select="@grapht:pos"/>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <grapht:analyze_nodes.tree.ancestors>
- <xsl:for-each select="grapht:analyze_nodes.tree.childs/*[ matches(@p5:primaryKey,$debug.filter) ]" ><!-\-group-by="@fid" FILTERING -\->
- <xsl:sort select="@grapht:fid"/>
- <xsl:variable name="current.analyze_nodes.tree.ancestors.fid" select="@grapht:fid"/>
- <!-\-<xsl:variable name="current.analyze_nodes.tree.ancestors.pos" select="@grapht:pos"/>-\->
- <xsl:message>#245 current.analyze_nodes.tree.ancestors.fid=<xsl:value-of select="@grapht:fid"/>; <!-\-@grapht:pos=<xsl:value-of select="@grapht:pos"/>;-\-></xsl:message>
- <!-\- grapht:ancestor.path.len -\->
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <grapht:analyze_nodes.tree.childs.paths.to_childs>
- <!-\- <xsl:for-each select="current-group()">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>-\->
- <grapht:analyze_nodes.tree.childs.paths.to_childs.childs>
- <xsl:attribute name="debug">#223 dla znalezionych ojcow, szukam innych dzieci </xsl:attribute>
- <xsl:for-each select="root()//grapht:analyze_fid/grapht:analyze_nodes.tree[not(@grapht:fid=$current.parent.fid)]/grapht:analyze_nodes.tree.childs/*[@grapht:fid = $current.analyze_nodes.tree.ancestors.fid and matches(@p5:primaryKey,$debug.filter)]"> <!-\- FILTER -\->
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <!-\-<xsl:for-each select="ancestor::*">
- <ancestor>
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- </xsl:copy>
- </ancestor>
- </xsl:for-each>-\->
- </xsl:copy>
- </xsl:for-each>
- </grapht:analyze_nodes.tree.childs.paths.to_childs.childs>
- <!-\-</xsl:copy>
- </xsl:for-each>-\->
- </grapht:analyze_nodes.tree.childs.paths.to_childs>
- </xsl:copy>
- </xsl:for-each>
- </grapht:analyze_nodes.tree.ancestors>
- </xsl:copy>
- </xsl:for-each>
- </xsl:copy>
- </xsl:template>-->
-
-
- <!--<xsl:template match="*" mode="grapht:analyze_nodes.paths.analyze_fid">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <!-\- szukam unkalnych parentow jakie mam, z najkrotsza sciezka
- , a potem szukam dla nich jakie oni maja dzieci unikalne, najkrotsze sciezki
- -\->
- <xsl:for-each-group select=""></xsl:for-each-group>
-
- </xsl:copy>
- </xsl:template>-->
-
- <xsl:template match="*" mode="grapht:analyze_nodes.grapht.fid">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="grapht:fid" select="@*"/>
- <xsl:apply-templates mode="#current"/>
- </xsl:copy>
- </xsl:template>
-
-
- <xsl:template match="grapht:analyze_nodes.paths" mode="grapht:analyze_nodes.paths.unique">
- <grapht:analyze_nodes.paths.unique>
- <xsl:apply-templates mode="#current"/>
- </grapht:analyze_nodes.paths.unique>
- </xsl:template>
-
-
- <xsl:template match="*" mode="grapht:analyze_nodes.paths.unique">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="grapht:fid" select="@*"/>
- <xsl:apply-templates mode="grapht:analyze_nodes.paths.unique"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="grapht:analyze_fid" mode="grapht:analyze_nodes.paths.unique">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
-
- <xsl:for-each select="grapht:analyze_nodes.tree">
- <xsl:copy copy-namespaces="no">
- <xsl:copy-of select="@*"/>
- <xsl:variable name="grapht:anchestor.count" select="@grapht:anchestor.count"/>
- <xsl:variable name="current.parent.fid" select="@grapht:fid"/>
- <xsl:message>#437 mode grapht:analyze_nodes.paths.unique @grapht:fid=<xsl:value-of select="@grapht:fid"/>; </xsl:message>
- <xsl:copy-of select="grapht:analyze_nodes.tree.clousure"/>
- <grapht:analyze_nodes.tree.clousure.referred>
- <xsl:attribute name="debug.452.current.parent.fid" select="$current.parent.fid"/>
- <xsl:attribute name="grapht:anchestor.count" select="$grapht:anchestor.count"/>
- <xsl:for-each select="root()//*[grapht:analyze_nodes.tree.clousure[grapht:path[@grapht:fid = $current.parent.fid]]]">
- <xsl:copy copy-namespaces="no">
- <xsl:attribute name="grapht:path.len" select=" number($grapht:anchestor.count) - number(@grapht:anchestor.count)"/>
- <xsl:copy-of select="@*"/>
- </xsl:copy>
- </xsl:for-each>
- </grapht:analyze_nodes.tree.clousure.referred>
-
- </xsl:copy>
- </xsl:for-each>
- </xsl:copy>
- </xsl:template>
-
-
- <xsl:template match="*" mode="grapht:analyze_nodes.tree.clousure.searched">
- <xsl:param name="current.parent.fid" required="yes"/>
- <xsl:param name="grapht:fid" required="yes"/>
- <xsl:param name="grapht:path" select="1"/>
- <xsl:choose>
- <xsl:when test="descendant-or-self::*[@grapht:fid=$current.parent.fid ]">
- <xsl:attribute name="grapht:path" select="$grapht:path"/>
- <xsl:attribute name="grapht:node_from" select="@grapht:fid"/>
- </xsl:when>
- <xsl:otherwise>
- <!--<xsl:message>#552 going parent to search by grapht:path=<xsl:value-of select="$grapht:path"/>;</xsl:message>-->
- <xsl:apply-templates mode="grapht:analyze_nodes.tree.clousure.searched" select="parent::node()">
- <xsl:with-param name="current.parent.fid" select="$current.parent.fid"/>
- <xsl:with-param name="grapht:fid" select="$grapht:fid"/>
- <xsl:with-param name="grapht:path" select="number($grapht:path) + 1"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- </xsl:stylesheet>
|