postprocess.xsl 4.4 KB

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