build_edge_paths_with_PE_controll_loop.xsl 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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="edge_paths_with_PE_controll_temp" select="'edge_paths_with_PE_controll_temp'"/>
  8. <xsl:param name="edge_paths_with_PE_controll_temp.alias" select="'edge_paths_with_PE_controll_temp.alias'"/>
  9. <xsl:param name="edge_paths_with_PE_controll.xsl" select="'edge_paths_with_PE_controll.xsl'"/>
  10. <xsl:param name="edge_paths_with_PE_controll.xml" select="'edge_paths_with_PE_controll.xml'"/>
  11. <xsl:param name="edge_paths_with_PE_controll_paths_temp" select="'edge_paths_with_PE_controll_paths_temp'"/>
  12. <xsl:param name="edge_joins_filled_paths" select="'edge_joins_filled_paths'"/>
  13. <xsl:param name="PE_Price" select="2500"/>
  14. <xsl:param name="Cable_Price" select="3"/>
  15. <xsl:param name="max_combinate_groups_elements" select="10"/> <!-- po ile wezlow mamy grupowac do wyliczania kombinacji kosztow -->
  16. <xsl:param name="logic" select="'grouped'"/>
  17. <xsl:output indent="yes"/>
  18. <xsl:strip-space elements="*"/>
  19. <xsl:template match="edge_joins_filled_paths">
  20. <project basedir="." name="edge_paths_with_PE_controll_loop.xml" default="edge_paths_with_PE_controll_loop">
  21. <target name="edge_paths_with_PE_controll_loop">
  22. <xsl:comment>test sort nie dziala</xsl:comment>
  23. <delete dir="{$edge_paths_with_PE_controll_temp}"/>
  24. <delete dir="{$edge_paths_with_PE_controll_temp.alias}"/>
  25. <delete dir="{$edge_paths_with_PE_controll_paths_temp}"/>
  26. <mkdir dir="{$edge_paths_with_PE_controll_paths_temp}"/>
  27. <symlink link="{$edge_paths_with_PE_controll_temp.alias}" resource="{$edge_paths_with_PE_controll_temp}"/>
  28. <xsl:variable name="item">
  29. <xsl:for-each select="item">
  30. <xsl:sort select="number(asText/@len)" order="descending"/>
  31. <item><xsl:copy-of select="@*"/></item>
  32. </xsl:for-each>
  33. </xsl:variable>
  34. <xsl:apply-templates select="$item"/>
  35. </target>
  36. </project>
  37. </xsl:template>
  38. <xsl:template match="item">
  39. <delete file="{$edge_paths_with_PE_controll_paths_temp}/{$edge_paths_with_PE_controll.xsl}.{@id}.xml"/>
  40. <xslt basedir="./" style="{$edge_paths_with_PE_controll.xsl}"
  41. in="{$edge_joins_filled_paths}/{$edge_joins_filled_paths}.{@id}.xml" destdir="./"
  42. out="{$edge_paths_with_PE_controll.xsl}.{@id}.xml" >
  43. <factory name="net.sf.saxon.TransformerFactoryImpl">
  44. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  45. <!--<attribute name="http://saxon.sf.net/feature/initialMode" value="DITA_PARSE_templ"/>-->
  46. <!--<attribute name="http://saxon.sf.net/feature/initialTemplate" value="asd"/>-->
  47. </factory>
  48. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  49. <param name="edge_paths_with_PE_controll_temp" expression="{$edge_paths_with_PE_controll_temp}"/>
  50. <param name="edge_paths_with_PE_controll_temp.alias" expression="{$edge_paths_with_PE_controll_temp.alias}"/>
  51. <param name="PE_Price" expression="{$PE_Price}"/>
  52. <param name="Cable_Price" expression="{$Cable_Price}"/>
  53. <param name="max_combinate_groups_elements" expression="{$max_combinate_groups_elements}"/> <!-- po ile wezlow mamy grupowac do wyliczania kombinacji kosztow -->
  54. <param name="logic" expression="{$logic}"/>
  55. <param name="edge_paths_with_PE_controll_paths_temp" expression="{$edge_paths_with_PE_controll_paths_temp}"/>
  56. <!--<xsl:param name="logic" select="'sorted'"/>--> <!-- tutaj robi grupy ale analizyje w grupie tylko wazniejsze/bardziej oblozone wezly -->
  57. </xslt>
  58. <move file="{$edge_paths_with_PE_controll.xsl}.{@id}.xml" todir="{$edge_paths_with_PE_controll_paths_temp}"/>
  59. </xsl:template>
  60. </xsl:stylesheet>