postprocess.xsl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  5. exclude-result-prefixes="xs"
  6. version="2.0">
  7. <xsl:output indent="yes"/>
  8. <xsl:strip-space elements="*"/>
  9. <xsl:param name="temp" required="yes"/>
  10. <xsl:param name="uuid" required="yes"/>
  11. <xsl:param name="postprocess_modules.xml" required="yes"/>
  12. <xsl:param name="basedir" required="yes"/>
  13. <xsl:param name="threadcount" select="'10'"/>
  14. <xsl:template mode="system_cache__appinfo:preprocess" match="preprocess_dita">
  15. <project basedir="{$temp}" name="project_for_{local-name()}" default="default">
  16. <property name="uuid" value="{$uuid}"/>
  17. <property name="temp" value="{$temp}"/>
  18. <target name="default">
  19. <parallel threadcount="{$threadcount}">
  20. <xsl:apply-templates mode="system_cache__appinfo:preprocess"/>
  21. </parallel>
  22. </target>
  23. </project>
  24. </xsl:template>
  25. <xsl:template mode="system_cache__appinfo:postprocess" match="postprocess_dita">
  26. <project basedir="{$temp}" name="project_for_{local-name()}" default="default">
  27. <property name="uuid" value="{$uuid}"/>
  28. <property name="temp" value="{$temp}"/>
  29. <target name="default">
  30. <parallel threadcount="{$threadcount}">
  31. <xsl:apply-templates mode="system_cache__appinfo:postprocess"/>
  32. </parallel>
  33. </target>
  34. </project>
  35. </xsl:template>
  36. <xsl:template mode="system_cache__appinfo:postprocess" match="base64_to_image">
  37. <xsl:choose>
  38. <xsl:when test="@srcfile and @dstfile">
  39. <exec executable="base64">
  40. <arg line="-i {@srcfile}"/>
  41. <arg line="-o {@dstfile}"/>
  42. <arg line="-D"/>
  43. </exec>
  44. </xsl:when>
  45. <xsl:otherwise>
  46. <xsl:message terminate="yes">#29 Not set @srcfile or @dstfile</xsl:message>
  47. </xsl:otherwise>
  48. </xsl:choose>
  49. </xsl:template>
  50. <xsl:template mode="system_cache__appinfo:preprocess" match="gml_to_image">
  51. <xsl:choose>
  52. <xsl:when test="@srcfile and @dstfile and @fileindex">
  53. <echo> convert gml 2 png for <xsl:value-of select="@srcfile"/> to <xsl:value-of select="@dstfile"/> , @fileindex=<xsl:value-of select="@fileindex"/>; - tymczasowy sposob mapowania do konfigu</echo>
  54. <xsl:variable name="current_node" select="."/>
  55. <xsl:variable name="postprocess_modules" select="doc($postprocess_modules.xml)"/>
  56. <xsl:for-each select="$postprocess_modules/postprocess_modules/node()[name()= current()/name()]">
  57. <xsl:for-each select="*">
  58. <sequential>
  59. <xsl:element name="{name()}">
  60. <xsl:copy-of select="@*"/>
  61. <property name="basedir" value="{$basedir}"/>
  62. <xsl:for-each select="property">
  63. <xsl:element name="{name()}">
  64. <xsl:attribute name="name" select="@name"/>
  65. <xsl:attribute name="value" select="$current_node/@*[name()= current()/@name]"/>
  66. <!--<xsl:copy-of select="@*"/>-->
  67. </xsl:element>
  68. </xsl:for-each>
  69. </xsl:element>
  70. </sequential>
  71. </xsl:for-each>
  72. </xsl:for-each>
  73. </xsl:when>
  74. <xsl:otherwise>
  75. <xsl:message terminate="yes">#29 Not set @srcfile or @dstfile</xsl:message>
  76. </xsl:otherwise>
  77. </xsl:choose>
  78. </xsl:template>
  79. </xsl:stylesheet>