| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?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="ways2drogi.xml" select="'ways2drogi.xml'"/>
- <xsl:variable name="ways2drogi" select="doc($ways2drogi.xml)"/>
- <xsl:param name="points2joins.xml" select="'points2joins.xml'"/>
- <xsl:variable name="points2joins" select="doc($points2joins.xml)"/>
- <xsl:param name="joins2ways_z_ID_Way_tempdir" select="'joins2ways_z_ID_Way'"/>
-
-
- <xsl:template match="joins2ways">
- <joins2ways_z_ID_Way>
- <!--<xsl:variable name="joins2ways">
- <xsl:apply-templates/>
- </xsl:variable>-->
- <!-- <xsl:for-each select="$joins2ways/item">-->
- <!-- <xsl:copy-of select="."/>-->
-
- <!--</xsl:for-each>-->
- <xsl:apply-templates/>
- </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="id" select="@id"/>
- <xsl:variable name="items">
- <xsl:for-each select="item">
- <item>
- <xsl:copy-of select="$item/@*"/>
- <xsl:attribute name="ID_Way" select="$ways2drogi/ways2drogi/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()"/>
- <!-- moze miec wiecej punktow-->
- <xsl:for-each select="$points2joins/points2joins/item[text()= $id]">
- <Points><xsl:value-of select=" @id"/></Points>
- </xsl:for-each>
- <xsl:for-each select="$item/item">
- <xsl:element name="item">
- <xsl:attribute name="id" select="@id"/>
- <xsl:attribute name="ID_WAY" select="$ways2drogi/ways2drogi/item[@id=current()/text()]/text()"/>
- <xsl:copy-of select="text()"/>
- </xsl:element>
- </xsl:for-each>
- </item>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:variable name="items_grouped">
- <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"/>
- <xsl:copy-of select="Points"/>
- </item>
- </xsl:for-each-group>
- </xsl:variable>
- <xsl:copy-of select="$items_grouped"/>
- <!--<xsl:result-document href="{$joins2ways_z_ID_Way_tempdir}/joins2ways_z_ID_Way.{@id}.{@ID_Way}.xml">
- <joins2ways_z_ID_Way>
- <xsl:attribute name="id" select="@id"/>
- <xsl:copy-of select="$items_grouped"/>
- </joins2ways_z_ID_Way>
- </xsl:result-document>-->
-
- </xsl:template>
-
- </xsl:stylesheet>
|