debug_biale_plamy.xsl 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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:output indent="yes"/>
  8. <xsl:strip-space elements="*"/>
  9. <xsl:variable name="biale_plamy_class_regenerate.php" select="biale_plamy_class_regenerate.php"/>
  10. <!--<xsl:variable name="ways_as_Text_z_ID_xml.xsl" select="ways_as_Text_z_ID_xml.xsl"/>-->
  11. <xsl:variable name="ways_as_Text_z_ID_xml.xml" select="ways_as_Text_z_ID_xml.xml"/>
  12. <xsl:variable name="biale_plamy_class_findWay.php" select="biale_plamy_class_findWay.php"/><!--<xsl:variable name="biale_plamy-find_ways.php" select="biale_plamy-find_ways.php"/>-->
  13. <xsl:variable name="joins_asText.xml" select="joins_asText.xml"/>
  14. <xsl:variable name="joins2ways.xml" select="joins2ways.xml"/>
  15. <xsl:variable name="points2ID_Way.xml" select="points2ID_Way.xml"/>
  16. <xsl:variable name="ways2drogi.xml" select="ways2drogi.xml"/><!--<xsl:variable name="ways_2ID_Way.xml" select="ways_2ID_Way.xml"/>-->
  17. <xsl:variable name="ways_asText.xml" select="ways_asText.xml"/>
  18. <xsl:variable name="waysLengths.xmll" select="waysLengths.xml"/>
  19. <!--<xsl:variable name="joins2ways_z_ID_Way.xsl" select="joins2ways_z_ID_Way.xsl"/>-->
  20. <xsl:variable name="joins2ways_z_ID_Way.xml" select="joins2ways_z_ID_Way.xml"/>
  21. <!--<xsl:variable name="biale_plamy_joins2ways_do_paths.xsl" select="biale_plamy_joins2ways_do_paths.xsl"/>-->
  22. <!--<xsl:variable name="edge_joins_filled_paths_make.xsl" select="edge_joins_filled_paths_make.xsl"/>-->
  23. <xsl:variable name="points_asText.xml" select="points_asText.xml"/>
  24. <xsl:variable name="points2joins.xml" select="points2joins.xml"/>
  25. <xsl:variable name="edge_joins.xml" select="edge_joins.xml"/>
  26. <!--<xsl:variable name="joins_asText_xml.xsl" select="joins_asText_xml.xsl"/>-->
  27. <xsl:variable name="joins_asText_xml.xml" select="joins_asText_xml.xml"/>
  28. <!-- sciezki -->
  29. <xsl:variable name="edge_joins_filled_paths.xml" select="edge_joins_filled_paths.xml"/>
  30. <!--<xsl:variable name="edge_paths_with_PE.xsl" select="edge_paths_with_PE.xsl"/>--><!-- stary-->
  31. <!--<xsl:variable name="edge_paths_with_PE_controll_to_PE.xsl" select="edge_paths_with_PE_controll_to_PE.xsl"/>-->
  32. <!--<xsl:variable name="edge_paths_with_PE_controll.xsl" select="edge_paths_with_PE_controll.xsl"/>--><!-- nowy point matrix-->
  33. <xsl:variable name="edge_paths_with_PE_controll_temp" select="edge_paths_with_PE_controll_temp"/> <!-- do oszukania silnika aby korzystac z petli i przekazywac dane do siebie -->
  34. <xsl:variable name="edge_paths_with_PE_controll_temp.alias" select="edge_paths_with_PE_controll_temp.alias"/>
  35. <xsl:variable name="edge_paths_with_PE_controll.xml" select="edge_paths_with_PE_controll.xml"/>
  36. <xsl:variable name="edge_paths_with_PE.xml" select="edge_paths_with_PE.xml"/><!-- biale_plamy_from_paths_php_to_place_PE-->
  37. <xsl:variable name="biale_put_PE_to_mysql.php" select="biale_put_PE_to_mysql.php"/>
  38. <!--<xsl:variable name="cables_from_joins_to_PE.xsl" select="cables_from_joins_to_PE.xsl"/>-->
  39. <xsl:variable name="cables_from_joins_to_PE.xml" select="cables_from_joins_to_PE.xml"/><!-- xml do wygenerowania -->
  40. <!--<xsl:variable name="biale_put_Cables_to_PE.php" select="biale_put_Cables_to_PE.php"/>-->
  41. <xsl:variable name="test_count">
  42. <rows>
  43. <row id="1">asd</row>
  44. <row id="2">1asd</row>
  45. <row id="3">2asd</row>
  46. <row id="4">3asd</row>
  47. <row id="5">4asd</row>
  48. <row id="6">5asd</row>
  49. <row id="7" not="1">6asd</row>
  50. <row id="8" not="1">7asd</row>
  51. <row id="9">8asd</row>
  52. <row id="10">9asd</row>
  53. <row id="11">10asd</row>
  54. <row id="12">11asd</row>
  55. <row id="13">12asd</row>
  56. <row id="14">13asd</row>
  57. <row id="15">14asd</row>
  58. <row id="16">15asd</row>
  59. <row id="17">16asd</row>
  60. </rows>
  61. </xsl:variable>
  62. <xsl:template name="main">
  63. <!-- sprawdzenie ilosci wezlow na drodze -->
  64. <!-- for each group mod 16 test -->
  65. <xsl:variable name="test_2">
  66. <test_2>
  67. <xsl:for-each select="$test_count/rows/*">
  68. <row>
  69. <xsl:copy-of select="@*"/>
  70. <xsl:attribute name="pos" select="position()"/>
  71. <xsl:choose>
  72. <xsl:when test="position() mod 3 = 0">
  73. <xsl:attribute name="pos_gr" select="1"/>
  74. </xsl:when>
  75. <xsl:otherwise><xsl:attribute name="pos_gr" select="0"/></xsl:otherwise>
  76. </xsl:choose>
  77. <xsl:choose>
  78. <xsl:when test="@not"/>
  79. <xsl:otherwise><xsl:attribute name="not" select="0"/></xsl:otherwise>
  80. </xsl:choose>
  81. <xsl:copy-of select=" text()"/>
  82. </row>
  83. </xsl:for-each>
  84. </test_2>
  85. </xsl:variable>
  86. <xsl:copy-of select="$test_2"/>
  87. <xsl:variable name="test_3">
  88. <test_3>
  89. <xsl:for-each select="$test_2/test_2/*">
  90. <row>
  91. <xsl:copy-of select="@*"/>
  92. <xsl:variable name="cur_pos" select="@pos"/>
  93. <xsl:attribute name="gr_id" select="sum($test_2/test_2/row[ number(@pos) &lt; $cur_pos]/number(@id)) - sum($test_2/test_2/row[ number(@pos) &lt; $cur_pos]/number(@not))"/>
  94. <xsl:attribute name="test_id" select="@test"/>
  95. <!--<co_jest_nizej>
  96. <xsl:copy-of select="$test_2/test_2/row[number(@pos) &lt; number($cur_pos)]"/>
  97. </co_jest_nizej>-->
  98. <xsl:copy-of select=" text()"/>
  99. </row>
  100. </xsl:for-each>
  101. </test_3>
  102. </xsl:variable>
  103. <xsl:copy-of select="$test_3"></xsl:copy-of>
  104. <test_4>
  105. <xsl:for-each-group select="$test_3/test_3" group-by="sum(@pos_gr)">
  106. <group>
  107. <xsl:for-each select="current-group()">
  108. <row>
  109. <xsl:copy-of select="."/>
  110. </row>
  111. </xsl:for-each>
  112. </group>
  113. </xsl:for-each-group>
  114. </test_4>
  115. </xsl:template>
  116. </xsl:stylesheet>