| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?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:variable name="test"/>
-
- <!--//match edge_joins_filled_paths-->
-
-
- <xsl:template match="edge_joins_filled_paths">
- <xsl:variable name="PE_track">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:variable name="PE_track">
- <xsl:for-each select="$PE_track/LINESTRING">
- <LINESTRING>
- <xsl:attribute name="Count" select="count(*)"/>
- <xsl:copy-of select="@*"/>
- <xsl:copy-of select="test1"/>
- <xsl:for-each select="bp:Path_Point">
- <bp:Path_Point>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="Pos" select="position()"/>
- <xsl:copy-of select="."/>
- </bp:Path_Point>
- </xsl:for-each>
- </LINESTRING>
- </xsl:for-each>
- </xsl:variable>
- <edge_paths_with_PE>
- <!--<PE_track>
- <xsl:copy-of select="$PE_track"/>
- </PE_track>-->
- <xsl:copy-of select="$PE_track"/>
- </edge_paths_with_PE>
- </xsl:template>
-
- <xsl:template match="item">
- <xsl:choose>
- <xsl:when test="asText">
- <LINESTRING>
- <xsl:attribute name="ID_Way" select="@id"/>
- <xsl:attribute name="distance" select="distance/text()"/>
- <xsl:apply-templates/>
- </LINESTRING>
- </xsl:when>
- <xsl:otherwise>
- <bp:Path_Not_Found>
- <xsl:attribute name="ID_Way" select="@id"/>
- </bp:Path_Not_Found>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!--<asText>LINESTRING (18.636657356658 51.253416226324, 18.6366871 51.253538999079, 18.6367062
- 51.253605499079, 18.6368933 51.25441199908, 18.6369493 51.254670399079, 18.6370223
- 51.254905799079, 18.6370965 51.255053899079, 18.6371814 51.255153699079, 18.637252
- 51.255236599079, 18.63765 51.255476599079, 18.6386978 51.255913099079, 18.6414059
- 51.257032799079, 18.6449346 51.25849289908, 18.6467805 51.25926169908, 18.64743915153
- 51.259545049387)</asText>-->
- <xsl:template match="asText">
- <xsl:variable name="LINESTRING" select=" substring-before( substring-after(.,'LINESTRING (') , ')') "/>
- <test1><xsl:copy-of select="$LINESTRING"/></test1>
- <xsl:for-each select="tokenize($LINESTRING,', ')">
- <bp:Path_Point>
- <test2><xsl:copy-of select="."/></test2>
- <xsl:for-each select="tokenize(.,' ')">
- <pos>
- <xsl:attribute name="pos" select="position()"/>
- <xsl:value-of select="."/>
- </pos>
- </xsl:for-each>
- </bp:Path_Point>
- </xsl:for-each>
- </xsl:template>
-
- </xsl:stylesheet>
|