build_edge_paths_with_PE_controll_loop.xsl 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. <delete dir="{$edge_paths_with_PE_controll_temp}"/>
  23. <delete dir="{$edge_paths_with_PE_controll_temp.alias}"/>
  24. <mkdir dir="{$edge_paths_with_PE_controll_temp}"/>
  25. <symlink link="{$edge_paths_with_PE_controll_temp.alias}" resource="{$edge_paths_with_PE_controll_temp}"/>
  26. <xsl:apply-templates>
  27. <xsl:sort select="item/asText/@len" />
  28. </xsl:apply-templates>
  29. </target>
  30. </project>
  31. </xsl:template>
  32. <xsl:template match="item">
  33. <delete file="{$edge_paths_with_PE_controll_paths_temp}/{$edge_paths_with_PE_controll.xsl}.{@id}.xml"/>
  34. <xslt basedir="./" style="{$edge_paths_with_PE_controll.xsl}"
  35. in="{$edge_joins_filled_paths}/{$edge_joins_filled_paths}.{@id}.xml" destdir="./"
  36. out="{$edge_paths_with_PE_controll_paths_temp}/{$edge_paths_with_PE_controll.xsl}.{@id}.xml" >
  37. <factory name="net.sf.saxon.TransformerFactoryImpl">
  38. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  39. <!--<attribute name="http://saxon.sf.net/feature/initialMode" value="DITA_PARSE_templ"/>-->
  40. <!--<attribute name="http://saxon.sf.net/feature/initialTemplate" value="asd"/>-->
  41. </factory>
  42. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  43. <param name="edge_paths_with_PE_controll_temp" expression="{$edge_paths_with_PE_controll_temp}"/>
  44. <param name="edge_paths_with_PE_controll_temp.alias" expression="{$edge_paths_with_PE_controll_temp.alias}"/>
  45. <param name="PE_Price" expression="{$PE_Price}"/>
  46. <param name="Cable_Price" expression="{$Cable_Price}"/>
  47. <param name="max_combinate_groups_elements" expression="{$max_combinate_groups_elements}"/> <!-- po ile wezlow mamy grupowac do wyliczania kombinacji kosztow -->
  48. <param name="logic" expression="{$logic}"/>
  49. <!--<xsl:param name="logic" select="'sorted'"/>--> <!-- tutaj robi grupy ale analizyje w grupie tylko wazniejsze/bardziej oblozone wezly -->
  50. </xslt>
  51. </xsl:template>
  52. </xsl:stylesheet>