| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?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:template match="asText">
- <xsl:variable name="LINESTRING" select=" substring-before( substring-after(normalize-space(.),'LINESTRING (') , ')') "/>
- <!--<test1><xsl:copy-of select="$LINESTRING"/></test1>-->
- <xsl:for-each select="tokenize($LINESTRING,',')">
- <bp:Path_Point>
- <!--<xsl:attribute name="test2" select="."/>-->
- <xsl:variable name="pos">
- <xsl:for-each select="tokenize(.,' ')">
- <pos>
- <xsl:attribute name="pos" select="position()"/>
- <xsl:value-of select="."/>
- </pos>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($pos/pos[@pos=1]/text())>0">
- <xsl:attribute name="X" select="$pos/pos[@pos=1]"/>
- <xsl:attribute name="Y" select="$pos/pos[@pos=2]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="X" select="$pos/pos[@pos=2]"/>
- <xsl:attribute name="Y" select="$pos/pos[@pos=3]"/>
- </xsl:otherwise>
- </xsl:choose>
- <!--<test3><xsl:copy-of select="$pos"/></test3>-->
- </bp:Path_Point>
- </xsl:for-each>
- </xsl:template>
-
-
- <xsl:template match="asText" mode="POINT">
- <xsl:variable name="LINESTRING" select=" substring-before( substring-after(normalize-space(.),'POINT (') , ')') "/>
- <!--<test1><xsl:copy-of select="$LINESTRING"/></test1>-->
- <xsl:for-each select="tokenize($LINESTRING,',')">
- <bp:Path_Point>
- <!--<xsl:attribute name="test2" select="."/>-->
- <xsl:variable name="pos">
- <xsl:for-each select="tokenize(.,' ')">
- <pos>
- <xsl:attribute name="pos" select="position()"/>
- <xsl:value-of select="."/>
- </pos>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($pos/pos[@pos=1]/text())>0">
- <xsl:attribute name="X" select="$pos/pos[@pos=1]"/>
- <xsl:attribute name="Y" select="$pos/pos[@pos=2]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="X" select="$pos/pos[@pos=2]"/>
- <xsl:attribute name="Y" select="$pos/pos[@pos=3]"/>
- </xsl:otherwise>
- </xsl:choose>
- <!--<test3><xsl:copy-of select="$pos"/></test3>-->
- </bp:Path_Point>
- </xsl:for-each>
- </xsl:template>
- </xsl:stylesheet>
|