build_edge_paths_with_PE_controll_loop.xsl 4.6 KB

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