joins_asText_xml.xsl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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:import href="asText.xsl"/>
  8. <xsl:param name="plamy_prefix" select="'test2'"/>
  9. <xsl:param name="points2joins.xml" select="concat('points2joins',$plamy_prefix,'.xml')"/>
  10. <xsl:variable name="points2joins" select="doc($points2joins.xml)"/>
  11. <xsl:output indent="yes"/>
  12. <xsl:strip-space elements="*"/>
  13. <xsl:template match="joins_asText">
  14. <joins_asText_xml>
  15. <xsl:apply-templates/>
  16. </joins_asText_xml>
  17. </xsl:template>
  18. <xsl:template match="item">
  19. <item>
  20. <xsl:copy-of select="@id"/>
  21. <xsl:variable name="ID_Point" select="$points2joins/points2joins/item[@id= current()/@id]/text()"/>
  22. <xsl:if test="$ID_Point">
  23. <xsl:attribute name="ID_Point" select="$ID_Point"/>
  24. </xsl:if>
  25. <xsl:variable name="asText">
  26. <asText>
  27. <xsl:value-of select="text()"/>
  28. </asText>
  29. </xsl:variable>
  30. <xsl:apply-templates mode="POINT" select="$asText"/>
  31. </item>
  32. </xsl:template>
  33. </xsl:stylesheet>