| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?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"
- xmlns:bp="https://procesy5.pl/biale_plamy-schema.xsd"
- exclude-result-prefixes="xs"
- version="2.0">
- <xsl:output indent="yes"/>
- <xsl:strip-space elements="*"/>
- <xsl:param name="ways_2ID_Way.xml" select="'ways_2ID_Way.xml'"/>
- <xsl:variable name="ways_2ID_Way" select="doc($ways_2ID_Way.xml)"/>
- <xsl:variable name="points2joins" select="doc('points2joins.xml')"/>
-
- <xsl:template match="joins2ways">
- <joins2ways_z_ID_Way>
- <xsl:variable name="joins2ways">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:for-each select="$joins2ways/item">
- <!--<xsl:sort select="number(@ID_Way)"/>-->
- <xsl:copy-of select="."/>
- </xsl:for-each>
- </joins2ways_z_ID_Way>
- </xsl:template>
- <xsl:template match="item">
- <xsl:variable name="item" select="."/>
- <xsl:variable name="ID_Point" select="$points2joins/points2joins/item[text()= current()/@id]/@id"/>
- <xsl:variable name="items">
- <xsl:for-each select="item">
- <item>
- <xsl:copy-of select="$item/@*"/>
- <xsl:attribute name="ID_Way" select="$ways_2ID_Way/ways_2ID_Way/item[@id=current()/text()]/text()"/>
- <xsl:if test="$ID_Point">
- <xsl:attribute name="ID_Point" select="$ID_Point"/>
- </xsl:if>
- <xsl:attribute name="item_copied_pos" select="position()"/>
- <xsl:for-each select="$item/item">
- <xsl:element name="item">
- <xsl:attribute name="id" select="@id"/>
- <xsl:attribute name="ID_WAY" select="$ways_2ID_Way/ways_2ID_Way/item[@id=current()/text()]/text()"/>
- <xsl:copy-of select="text()"/>
- </xsl:element>
- </xsl:for-each>
- </item>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:for-each-group select="$items/item" group-by="@ID_Way">
- <item>
- <xsl:copy-of select="@*"/>
- <!--<xsl:attribute name="ID_Way_count" select="$ID_Way_count"/>-->
- <xsl:copy-of select="item"/>
- </item>
- </xsl:for-each-group>
- <!--<item>
- <xsl:copy-of select="@*"/>
- <xsl:if test="$ways_2ID_Way/ways_2ID_Way/item[@id=current()/item[1]/text()]/text()">
- <xsl:attribute name="ID_Way" select="$ways_2ID_Way/ways_2ID_Way/item[@id=current()/item[1]/text()]/text()"/>
- </xsl:if>
- <xsl:if test="$points2joins/points2joins/item[text()= current()/@id]">
- <xsl:attribute name="ID_Point" select="$points2joins/points2joins/item[text()= current()/@id]/@id"/>
- </xsl:if>
- <xsl:for-each select="item">
- <xsl:element name="item">
- <xsl:attribute name="id" select="@id"/>
- <xsl:attribute name="ID_WAY" select="$ways_2ID_Way/ways_2ID_Way/item[@id=current()/text()]/text()"/>
- <xsl:copy-of select="text()"/>
- </xsl:element>
- </xsl:for-each>
-
- </item>-->
- <!-- dorzucenie do joins sztucznie joinow jako ze pochodza z innych ID_Way -->
-
- </xsl:template>
-
- </xsl:stylesheet>
|