edge_paths_with_PE_fixed.xsl 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
  6. exclude-result-prefixes="xs"
  7. version="2.0">
  8. <xsl:output indent="yes"/>
  9. <xsl:strip-space elements="*"/>
  10. <xsl:param name="plamy_prefix" />
  11. <xsl:param name="PE_fixings.xml" select="concat('PE_fixings',$plamy_prefix,'.xml')"/>
  12. <xsl:param name="PE_fixings" select=" doc($PE_fixings.xml)"/>
  13. <xsl:param name="edge_paths_with_PE_controll_paths_temp" select="'edge_paths_with_PE_controll_paths_temp'"/>
  14. <!-- <xsl:param name="edge_paths_with_PE_controll_paths_temp_fixed" select="'edge_paths_with_PE_controll_paths_temp_fixed'"/>
  15. <xsl:template match="edge_joins_filled_paths" mode="edge_paths_with_PE_controll_paths_temp_fixed">
  16. <xsl:apply-templates mode="edge_paths_with_PE_controll_paths_temp_fixed"></xsl:apply-templates>
  17. </xsl:template>
  18. <xsl:template match="item" mode="edge_paths_with_PE_controll_paths_temp_fixed">
  19. <xsl:result-document href="{$edge_paths_with_PE_controll_paths_temp_fixed}/edge_paths_with_PE_controll.xsl.{@id}.xml'">
  20. <xsl:variable name="edge_paths_with_PE_controll" select="doc(concat($edge_paths_with_PE_controll_paths_temp,'/edge_paths_with_PE_controll.xsl.',@id,'.xml'))"/>
  21. <xsl:apply-templates select="$edge_paths_with_PE_controll" mode="edge_paths_with_PE_controll_paths_temp_fixed_contr"/>
  22. </xsl:result-document>
  23. </xsl:template>
  24. <xsl:template mode="edge_paths_with_PE_controll_paths_temp_fixed" match="edge_paths_with_PE_controll_fixed">
  25. <edge_paths_with_PE_controll_fixed>
  26. <xsl:copy-of select="@*"/>
  27. <xsl:apply-templates mode="edge_paths_with_PE_controll_paths_temp_fixed_contr"/>
  28. </edge_paths_with_PE_controll_fixed>
  29. </xsl:template>
  30. <xsl:template mode="edge_paths_with_PE_controll_paths_temp_fixed_contr" match="Path|EdgeWayJoinsPair|edge_joins_filled_paths_xml|asText_XMl">
  31. <xsl:element name="{name()}">
  32. <xsl:copy-of select="@*"/>
  33. <xsl:apply-templates mode="edge_paths_with_PE_controll_paths_temp_fixed_contr"/>
  34. </xsl:element>
  35. </xsl:template>
  36. <xsl:template mode="edge_paths_with_PE_controll_paths_temp_fixed_contr" match="LineString">
  37. <xsl:choose>
  38. <xsl:when test="$PE_fixings/wfs:FeatureCollection//p5_default_db:ID_Join[ text()=current()/@ID_Join and not(parent::node()/p5_default_db:the_geom/gml:Point)]">
  39. <edge_paths_with_PE_fixed>
  40. <xsl:message terminate="no">Found Join fixed @ID_Join=<xsl:value-of select="@ID_Join"/>;</xsl:message>
  41. <xsl:attribute name="debug" select="'point removed and detected in PE_fixings.xml'"/>
  42. <xsl:copy-of select="@*"/>
  43. </edge_paths_with_PE_fixed>
  44. </xsl:when>
  45. <xsl:otherwise>
  46. <xsl:copy-of select="."/>
  47. </xsl:otherwise>
  48. </xsl:choose>
  49. </xsl:template>-->
  50. <xsl:template match="PE_candidates_dump">
  51. <PE_candidates_dump>
  52. <xsl:apply-templates/>
  53. </PE_candidates_dump>
  54. </xsl:template>
  55. <xsl:template match="LINESTRING">
  56. <LINESTRING>
  57. <xsl:copy-of select="@*"/>
  58. <xsl:apply-templates/>
  59. </LINESTRING>
  60. </xsl:template>
  61. <xsl:template match="bp:Path_Point">
  62. <xsl:choose>
  63. <xsl:when test="$PE_fixings/wfs:FeatureCollection//p5_default_db:ID_Join[ text()=current()/@ID_Join and not(parent::node()/p5_default_db:the_geom/gml:Point)]">
  64. <edge_paths_with_PE_fixed>
  65. <xsl:message terminate="no">Found Join fixed @ID_Join=<xsl:value-of select="@ID_Join"/>;</xsl:message>
  66. <xsl:attribute name="debug" select="'point removed and detected in PE_fixings.xml'"/>
  67. <xsl:copy-of select="@*"/>
  68. </edge_paths_with_PE_fixed>
  69. </xsl:when>
  70. <xsl:otherwise>
  71. <xsl:copy-of select="."/>
  72. </xsl:otherwise>
  73. </xsl:choose>
  74. </xsl:template>
  75. </xsl:stylesheet>