|
|
@@ -26,13 +26,108 @@
|
|
|
-->
|
|
|
|
|
|
<xsl:template match="joins2ways_z_ID_Way">
|
|
|
- <xsl:variable name="EdgeWayJoinsPair_cand">
|
|
|
+ <!--<xsl:variable name="EdgeWayJoinsPair_cand">
|
|
|
<xsl:apply-templates mode="joins"/>
|
|
|
+ </xsl:variable>-->
|
|
|
+ <!--<xsl:variable name="joins2ways_z_ID_Way" select="."/>-->
|
|
|
+ <!--<xsl:copy-of select="$EdgeWayJoinsPair_cand"></xsl:copy-of>-->
|
|
|
+ <!--<xsl:choose>
|
|
|
+ <xsl:when test="$EdgeWayJoinsPair_cand/EdgeWayJoinsPair_cand[@ID_Way=current()/@ID_Way]">
|
|
|
+ <JESTOK></JESTOK>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>-->
|
|
|
+ <!--<xsl:copy-of select="$EdgeWayJoinsPair_cand/no_EdgeWayJoinsPair"></xsl:copy-of>-->
|
|
|
+ <xsl:variable name="guess_edges">
|
|
|
+
|
|
|
+ <xsl:for-each select="item">
|
|
|
+ <guess_join>
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ <xsl:variable name="ID_Way">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@ID_Way"><xsl:value-of select="@ID_Way"/></xsl:when>
|
|
|
+ <xsl:otherwise><xsl:value-of select="0"/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:apply-templates select="." mode="joins_not_way">
|
|
|
+ <xsl:with-param name="ID_Way" select="$ID_Way"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ </guess_join>
|
|
|
+ </xsl:for-each>
|
|
|
+
|
|
|
</xsl:variable>
|
|
|
- <xsl:variable name="joins2ways_z_ID_Way" select="."/>
|
|
|
|
|
|
<EdgeWayJoins>
|
|
|
- <xsl:for-each-group select="$EdgeWayJoinsPair_cand/EdgeWayJoinsPair_cand" group-by="@ID_Way">
|
|
|
+ <!--<xsl:for-each-group select="$EdgeWayJoinsPair_cand/no_EdgeWayJoinsPair" group-by="@ID_Way">
|
|
|
+ <EdgeWayJoinsPair>
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ <xsl:variable name="ID_Way" select="@ID_Way"/>
|
|
|
+ <xsl:variable name="Joins_miss">
|
|
|
+ <xsl:for-each select="$joins2ways_z_ID_Way/item[@ID_Way=$ID_Way and count( child::node())>1 ]">
|
|
|
+ <!-\- szukamy joinsa ktory ma joina do innego waysa-\->
|
|
|
+ <xsl:variable name="Join_ID" select="@id"/>
|
|
|
+ <xsl:for-each select="item">
|
|
|
+ <ways>
|
|
|
+ <xsl:attribute name="id_join" select="$Join_ID"/>
|
|
|
+ <xsl:attribute name="id_way" select="text()"/>
|
|
|
+ </ways>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:copy-of select="$Joins_miss"/>
|
|
|
+ <xsl:variable name="Ways_miss">
|
|
|
+ <xsl:for-each select="$Joins_miss/ways">
|
|
|
+ <xsl:variable name="id_join" select="@id_join"/>
|
|
|
+ <xsl:variable name="id_way_test" select="@id_way"/>
|
|
|
+ <xsl:for-each select="$ways2joins/ways2joins/item[@id=$id_way_test]/item">
|
|
|
+ <found_joins_in_ways>
|
|
|
+ <xsl:attribute name="id_join" select="$id_join"/>
|
|
|
+ <xsl:attribute name="id_join_found" select="text()"/>
|
|
|
+ </found_joins_in_ways>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:copy-of select="$Ways_miss"/>
|
|
|
+ <xsl:for-each select="$Ways_miss/found_joins_in_ways"> <!-\- [not(@id_join_found=$EdgeJoinFound)]-\->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="not($Joins_miss/ways[@id_join=current()/@id_join_found])">
|
|
|
+ <!-\-<missed>-\->
|
|
|
+ <!-\-<xsl:attribute name="Joins" select="@id_join"/>-\->
|
|
|
+ <bp:Joins>
|
|
|
+ <xsl:attribute name="Joins" select="current()/@id_join_found"/>
|
|
|
+ </bp:Joins>
|
|
|
+ <!-\-</missed>-\->
|
|
|
+ </xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each>
|
|
|
+ </EdgeWayJoinsPair>
|
|
|
+ </xsl:for-each-group>-->
|
|
|
+ <xsl:for-each-group select="item" group-by="@ID_Way">
|
|
|
+ <xsl:variable name="ID_Way" select="@ID_Way"/>
|
|
|
+
|
|
|
+ <EdgeWayJoinsPair>
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ <!--<xsl:copy-of select="$guess_edges/guess_join[@ID_Way=$ID_Way]"></xsl:copy-of>-->
|
|
|
+ <xsl:for-each select="$guess_edges/guess_join[@ID_Way=$ID_Way]/EdgeWayJoinsPair_cand">
|
|
|
+ <bp:Joins>
|
|
|
+ <xsl:attribute name="Joins" select="@joins"/>
|
|
|
+ </bp:Joins>
|
|
|
+ </xsl:for-each>
|
|
|
+ <!--<xsl:for-each select="current-group()">
|
|
|
+ <!-\-<GROUP><xsl:copy-of select="item("></xsl:copy-of></GROUP>-\->
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test=" position()=1 or position()=last()">
|
|
|
+ <bp:Joins>
|
|
|
+ <xsl:attribute name="Joins" select="@id"/>
|
|
|
+ </bp:Joins>
|
|
|
+ </xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each>-->
|
|
|
+ </EdgeWayJoinsPair>
|
|
|
+ </xsl:for-each-group>
|
|
|
+ <!--<xsl:for-each-group select="$EdgeWayJoinsPair_cand/EdgeWayJoinsPair_cand" group-by="@ID_Way">
|
|
|
<EdgeWayJoinsPair>
|
|
|
<xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
<xsl:variable name="ID_Way" select="@ID_Way"/>
|
|
|
@@ -46,7 +141,7 @@
|
|
|
<bp:Joins>
|
|
|
<xsl:variable name="Joins_miss">
|
|
|
<xsl:for-each select="$joins2ways_z_ID_Way/item[@ID_Way=$ID_Way and count( child::node())=2 ]">
|
|
|
- <!-- szukamy joinsa ktory ma joina do innego waysa-->
|
|
|
+ <!-\- szukamy joinsa ktory ma joina do innego waysa-\->
|
|
|
<xsl:variable name="Join_ID" select="@id"/>
|
|
|
<xsl:for-each select="item">
|
|
|
<ways>
|
|
|
@@ -56,7 +151,7 @@
|
|
|
</xsl:for-each>
|
|
|
</xsl:for-each>
|
|
|
</xsl:variable>
|
|
|
- <!--<xsl:copy-of select="$Joins_miss"></xsl:copy-of>-->
|
|
|
+ <!-\-<xsl:copy-of select="$Joins_miss"></xsl:copy-of>-\->
|
|
|
<xsl:variable name="Ways_miss">
|
|
|
<xsl:for-each select="$Joins_miss/ways">
|
|
|
<xsl:variable name="id_join" select="@id_join"/>
|
|
|
@@ -69,14 +164,14 @@
|
|
|
</xsl:for-each>
|
|
|
</xsl:for-each>
|
|
|
</xsl:variable>
|
|
|
- <!--<xsl:copy-of select="$Ways_miss"/>-->
|
|
|
+ <!-\-<xsl:copy-of select="$Ways_miss"/>-\->
|
|
|
<xsl:for-each select="$Ways_miss/found_joins_in_ways[not(@id_join_found=$EdgeJoinFound)]">
|
|
|
<xsl:choose>
|
|
|
<xsl:when test="not($Joins_miss/ways[@id_join=current()/@id_join_found])">
|
|
|
- <!--<missed>-->
|
|
|
- <!--<xsl:attribute name="Joins" select="@id_join"/>-->
|
|
|
+ <!-\-<missed>-\->
|
|
|
+ <!-\-<xsl:attribute name="Joins" select="@id_join"/>-\->
|
|
|
<xsl:attribute name="Joins" select="current()/@id_join_found"/>
|
|
|
- <!--</missed>-->
|
|
|
+ <!-\-</missed>-\->
|
|
|
</xsl:when>
|
|
|
</xsl:choose>
|
|
|
</xsl:for-each>
|
|
|
@@ -85,7 +180,7 @@
|
|
|
</xsl:choose>
|
|
|
</xsl:for-each>
|
|
|
</EdgeWayJoinsPair>
|
|
|
- </xsl:for-each-group>
|
|
|
+ </xsl:for-each-group>-->
|
|
|
</EdgeWayJoins>
|
|
|
</xsl:template>
|
|
|
|
|
|
@@ -94,15 +189,95 @@
|
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
+ <xsl:template match="item" mode="joins_not_way">
|
|
|
+ <xsl:param name="ID_Way" required="yes"/>
|
|
|
+ <xsl:variable name="count_our_way">
|
|
|
+ <xsl:for-each select="item">
|
|
|
+ <xsl:element name="count_our_way">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@ID_WAY=$ID_Way">1</xsl:when>
|
|
|
+ <xsl:otherwise>0</xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <see>
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ <inside>
|
|
|
+ <xsl:attribute name="count_our" select="count(item[@ID_WAY=$ID_Way])"/>
|
|
|
+ <count_our_way_val>
|
|
|
+ <xsl:copy-of select="$count_our_way"/>
|
|
|
+ </count_our_way_val>
|
|
|
+ <xsl:for-each select="item[@ID_WAY!=$ID_Way]">
|
|
|
+ <xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="joins" select="../@id"/>
|
|
|
+ <xsl:attribute name="ID_Way" select="../@ID_Way"/>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:for-each>
|
|
|
+ </inside>
|
|
|
+ </see>
|
|
|
+ <xsl:variable name="if_item_not_in_way">
|
|
|
+ <xsl:for-each select="item">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="not(@ID_WAY=$ID_Way)">
|
|
|
+ <xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="joins" select="../@id"/>
|
|
|
+ <xsl:attribute name="ID_Way" select="../@ID_Way"/>
|
|
|
+ </xsl:element></xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+
|
|
|
+
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="count(item)=1">
|
|
|
+ <xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="pos" select="position()"/>
|
|
|
+ <xsl:attribute name="joins" select="@id"/>
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ <xsl:attribute name="ways" select="item/text()"/>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$if_item_not_in_way/EdgeWayJoinsPair_cand and count(item[@ID_WAY=$ID_Way])<2">
|
|
|
+ <xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="debug" select="'has other way'"/>
|
|
|
+ <xsl:attribute name="joins" select="@id"/>
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ <xsl:attribute name="ways">
|
|
|
+ <xsl:for-each select="item/text()">
|
|
|
+ <xsl:value-of select=" concat(.,' ')"/>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:attribute>
|
|
|
+ <!--<xsl:attribute name="ways" select="item/text()" separator="', '" />-->
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
<xsl:template match="item" mode="joins">
|
|
|
+ <!--<xsl:param name="second_turn" />-->
|
|
|
<xsl:choose>
|
|
|
+ <!--<xsl:when test="count(item[@ID_WAY=current()/@ID_Way])>1">
|
|
|
+ <xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="joins" select="@id"/>
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ <xsl:attribute name="ways" select="item/text()"/>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:when>-->
|
|
|
<xsl:when test="count(item)=1">
|
|
|
<xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="pos" select="position()"/>
|
|
|
<xsl:attribute name="joins" select="@id"/>
|
|
|
<xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
<xsl:attribute name="ways" select="item/text()"/>
|
|
|
</xsl:element>
|
|
|
</xsl:when>
|
|
|
+ <!--<xsl:when test="count(../item[@ID_Way=current()/@ID_Way]) and count( child::node()=1)">
|
|
|
+ <xsl:element name="no_EdgeWayJoinsPair">
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ </xsl:element>
|
|
|
+
|
|
|
+ </xsl:when>-->
|
|
|
<!--<xsl:when test="count(item)=2">
|
|
|
<xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
<xsl:attribute name="joins" select="@id"/>
|