joins2ways_z_ID_Way.xsl 992 B

12345678910111213141516171819202122232425
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:bp="https://procesy5.pl/biale_plamy-schema.xsd"
  5. exclude-result-prefixes="xs"
  6. version="2.0">
  7. <xsl:param name="ways_2ID_Way.xml" select="'ways_2ID_Way.xml'"/>
  8. <xsl:variable name="ways_2ID_Way" select="doc($ways_2ID_Way.xml)"/>
  9. <xsl:template match="joins2ways">
  10. <joins2ways_z_ID_Way>
  11. <xsl:apply-templates/>
  12. </joins2ways_z_ID_Way>
  13. </xsl:template>
  14. <xsl:template match="item">
  15. <item>
  16. <xsl:copy-of select="@*"/>
  17. <xsl:if test="$ways_2ID_Way/ways_2ID_Way/item[@id=current()/item[1]/text()]/text()">
  18. <xsl:attribute name="ID_Way" select="$ways_2ID_Way/ways_2ID_Way/item[@id=current()/item[1]/text()]/text()"/>
  19. </xsl:if>
  20. <xsl:copy-of select="item"/>
  21. </item>
  22. </xsl:template>
  23. </xsl:stylesheet>