|
|
@@ -54,34 +54,68 @@
|
|
|
<xsl:variable name="Join_X" select="$joins_asText_Path_Point/joins_asText/item[@id=$Joins]/As_POINT_to_xml/@X"/>
|
|
|
<xsl:variable name="Join_Y" select="$joins_asText_Path_Point/joins_asText/item[@id=$Joins]/As_POINT_to_xml/@Y"/>
|
|
|
<xsl:attribute name="Join_X" select="$Join_X"/><xsl:attribute name="Join_Y" select="$Join_Y"/>
|
|
|
- <xsl:for-each select="$edge_joins_filled_paths/edge_joins_filled_paths/item[@id=$ID_Way]/bp:Path_Point">
|
|
|
- <xsl:variable name="diff_X" select=" number($Join_X)- number(@X)"/><xsl:variable name="diff_Y" select=" number($Join_Y)- number(@Y)"/>
|
|
|
- <xsl:variable name="bp:Path_Point" select="."/>
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="(abs($diff_X)<0.0001 and abs($diff_X)<0.0001) or ( @X=$Join_X and @Y=$Join_Y )">
|
|
|
- <found_in_path_in_edge_joins_filled_path>
|
|
|
- <xsl:attribute name="diff_X" select="$diff_X"/><xsl:attribute name="diff_Y" select="$diff_Y"/>
|
|
|
- <xsl:attribute name="position" select="position()"/>
|
|
|
- <xsl:copy-of select="."/>
|
|
|
+ <xsl:variable name="found_in_path_in_edge_joins_filled_path">
|
|
|
+ <xsl:for-each select="$edge_joins_filled_paths/edge_joins_filled_paths/item[@id=$ID_Way]/bp:Path_Point">
|
|
|
+ <xsl:variable name="diff_X" select=" number($Join_X)- number(@X)"/><xsl:variable name="diff_Y" select=" number($Join_Y)- number(@Y)"/>
|
|
|
+ <xsl:variable name="bp:Path_Point" select="."/>
|
|
|
+
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="(abs($diff_X)<0.0001 and abs($diff_X)<0.0001) or ( @X=$Join_X and @Y=$Join_Y )">
|
|
|
+ <found_in_path_in_edge_joins_filled_path>
|
|
|
+ <xsl:attribute name="diff_X" select="$diff_X"/><xsl:attribute name="diff_Y" select="$diff_Y"/>
|
|
|
+ <xsl:attribute name="position" select="position()"/>
|
|
|
+ <!--<bp:Path_Point_var><xsl:copy-of select="$bp:Path_Point"/></bp:Path_Point_var>-->
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ <xsl:call-template name="detect_next_PE">
|
|
|
+ <xsl:with-param name="bp:Path_Point" select="$bp:Path_Point"/>
|
|
|
+ <xsl:with-param name="ID_Way" select="$ID_Way"/>
|
|
|
+ <xsl:with-param name="Pos_found" select="position()"/>
|
|
|
+ <xsl:with-param name="edge_joins_filled_paths" select="$edge_joins_filled_paths"/>
|
|
|
+ <xsl:with-param name="ID_Point" select="$ID_Point"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </found_in_path_in_edge_joins_filled_path>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <not_found>
|
|
|
+ <xsl:attribute name="Pos" select="position()"/>
|
|
|
+ <xsl:attribute name="X" select="@X"/><xsl:attribute name="Y" select="@Y"/>
|
|
|
+ <xsl:attribute name="srch_X" select="$Join_X"/><xsl:attribute name="srch_Y" select="$Join_Y"/>
|
|
|
+ <xsl:attribute name="diff_X" select="$diff_X"/><xsl:attribute name="diff_Y" select="$diff_Y"/>
|
|
|
+ </not_found>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$found_in_path_in_edge_joins_filled_path/found_in_path_in_edge_joins_filled_path">
|
|
|
+ <xsl:for-each select="$found_in_path_in_edge_joins_filled_path/found_in_path_in_edge_joins_filled_path[1]">
|
|
|
+ <xsl:sort select="count(detect_next_PE/bp:Path_Point)" order="descending"/>
|
|
|
+ <debug>
|
|
|
+ <xsl:attribute name="debug_pos" select="position()"/>
|
|
|
+ <xsl:attribute name="Path_Point_count" select="count(detect_next_PE/bp:Path_Point)"/>
|
|
|
+ </debug>
|
|
|
+ <!--<found_in_path_in_edge_joins_filled_path>
|
|
|
+ <xsl:attribute name="debug_pos" select="position()"/>
|
|
|
+ <xsl:copy-of select="@*"/>
|
|
|
<xsl:call-template name="detect_next_PE">
|
|
|
- <xsl:with-param name="bp:Path_Point" select="$bp:Path_Point"/>
|
|
|
+ <xsl:with-param name="bp:Path_Point" select="bp:Path_Point_var"/>
|
|
|
<xsl:with-param name="ID_Way" select="$ID_Way"/>
|
|
|
- <xsl:with-param name="Pos_found" select="position()"/>
|
|
|
+ <xsl:with-param name="Pos_found" select="@position"/>
|
|
|
<xsl:with-param name="edge_joins_filled_paths" select="$edge_joins_filled_paths"/>
|
|
|
<xsl:with-param name="ID_Point" select="$ID_Point"/>
|
|
|
</xsl:call-template>
|
|
|
- </found_in_path_in_edge_joins_filled_path>
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <not_found>
|
|
|
- <xsl:attribute name="Pos" select="position()"/>
|
|
|
- <xsl:attribute name="X" select="@X"/><xsl:attribute name="Y" select="@Y"/>
|
|
|
- <xsl:attribute name="srch_X" select="$Join_X"/><xsl:attribute name="srch_Y" select="$Join_Y"/>
|
|
|
- <xsl:attribute name="diff_X" select="$diff_X"/><xsl:attribute name="diff_Y" select="$diff_Y"/>
|
|
|
- </not_found>
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:for-each>
|
|
|
+ </found_in_path_in_edge_joins_filled_path>-->
|
|
|
+
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+
|
|
|
+ </xsl:for-each>
|
|
|
+ <xsl:copy-of select="$found_in_path_in_edge_joins_filled_path/not_found"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:copy-of select="$found_in_path_in_edge_joins_filled_path"/>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
</cable_to_PE_to_be_calculated>
|
|
|
</xsl:when>
|
|
|
</xsl:choose>
|