procesy5_config.default_db.xsl 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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:p5build_SE="http://biuro.biall-net.pl/build_SE.xsd"
  5. exclude-result-prefixes="xs"
  6. version="2.0">
  7. <xsl:output indent="yes"/>
  8. <xsl:strip-space elements="*"/>
  9. <xsl:param name="procesy5_config.default_db.properties"/>
  10. <xsl:param name="basedir" required="yes"/>
  11. <xsl:param name="p5build_SE.build_procesy5_config.default_db.properties"/>
  12. <xsl:template match="procesy5_config">
  13. <p5build_SE:procesy5_config>
  14. <xsl:apply-templates/>
  15. </p5build_SE:procesy5_config>
  16. </xsl:template>
  17. <xsl:template match="procesy5_config.default_db.server">
  18. <procesy5_config.default_db.server>
  19. <xsl:variable name="procesy5_config.default_db.server">
  20. <xsl:apply-templates/>
  21. </xsl:variable>
  22. <xsl:apply-templates select="$procesy5_config.default_db.server" mode="from_tokenize"/>
  23. <!--<debug>
  24. <xsl:copy-of select="$procesy5_config.default_db.server"></xsl:copy-of>
  25. </debug>-->
  26. </procesy5_config.default_db.server>
  27. </xsl:template>
  28. <xsl:template match="*"/>
  29. <xsl:template match="text()">
  30. <xsl:for-each select="tokenize(.,'\[')">
  31. <lev1><xsl:attribute name="pos" select="position()"/>
  32. <xsl:for-each select="tokenize(.,'\]')">
  33. <lev2><xsl:attribute name="pos" select="position()"/>
  34. <xsl:for-each select="tokenize(.,'\n')">
  35. <levbr><xsl:attribute name="pos" select="position()"/>
  36. <xsl:for-each select=" tokenize(.,'=')">
  37. <lev3><xsl:attribute name="pos" select="position()"/>
  38. <xsl:value-of select="."/>
  39. </lev3>
  40. </xsl:for-each>
  41. </levbr>
  42. </xsl:for-each>
  43. </lev2>
  44. </xsl:for-each>
  45. </lev1>
  46. </xsl:for-each>
  47. </xsl:template>
  48. <xsl:template mode="from_tokenize" match="lev1[@pos='1']">
  49. <xsl:apply-templates mode="#current"/>
  50. </xsl:template>
  51. <xsl:template mode="from_tokenize" match="lev2[@pos='1']">
  52. <xsl:apply-templates mode="#current"/>
  53. </xsl:template>
  54. <xsl:template mode="from_tokenize" match="levbr[lev3[@pos='2']]"><!-- [lev3/@pos2] -->
  55. <xsl:element name="{lev3[@pos='1']}">
  56. <xsl:value-of select="replace(lev3[@pos='2'],'&quot;','')"/>
  57. </xsl:element>
  58. </xsl:template>
  59. <xsl:template mode="from_tokenize" match="*">
  60. <!--<ignored>
  61. <xsl:attribute name="name" select="name()"/>
  62. <attrs>
  63. <xsl:copy-of select="@*"/>
  64. </attrs>
  65. </ignored>-->
  66. </xsl:template>
  67. <!--<xsl:template mode="from_tokenize" match="lev1[@pos='1']"/>
  68. <xsl:template mode="from_tokenize" match="lev1">
  69. <xsl:element name="{lev2[@pos='1']/levbr[@pos='1']/lev3[@pos='1']/text()}">
  70. <xsl:for-each select="lev2[ number(@pos) &gt; 1]">
  71. <xsl:for-each select="levbr[number(@pos) &gt;1]">
  72. <xsl:for-each select="lev3">
  73. <xsl:if test="@pos div 2 mod 1 and not(contains(.,';'))">
  74. <xsl:element name="{text()}">
  75. <xsl:value-of select=" replace( normalize-space(../lev3[@pos= number(current()/@pos)+1]),'[&quot;;]','')"/>
  76. </xsl:element>
  77. </xsl:if>
  78. </xsl:for-each>
  79. </xsl:for-each>
  80. </xsl:for-each>
  81. </xsl:element>
  82. </xsl:template> -->
  83. <xsl:template match="p5build_SE:procesy5_config" mode="p5build_SE:build_procesy5_config.default_db.properties.xml">
  84. <project basedir="{$basedir}" name="p5build_SE.build_procesy5_config.default_db.properties.xml"
  85. default="p5build_SE.build_procesy5_config.default_db.properties.xml"
  86. xmlns:p5build_SE="http://biuro.biall-net.pl/build_SE.xsd">
  87. <xsl:comment>#98 This is generated by xsl:template match="p5build_SE:procesy5_config" mode="p5build_SE:build_procesy5_config.default_db.properties.xml"</xsl:comment>
  88. <xsl:apply-templates mode="#current"/>
  89. <target name="p5build_SE.build_procesy5_config.default_db.properties.xml">
  90. <echoproperties destfile="{$p5build_SE.build_procesy5_config.default_db.properties}" prefix="p5build_SE.procesy5_config.default_db"/>
  91. </target>
  92. </project>
  93. </xsl:template>
  94. <xsl:template match="procesy5_config.default_db.server" mode="p5build_SE:build_procesy5_config.default_db.properties.xml">
  95. <xsl:for-each select="*">
  96. <property name="p5build_SE.procesy5_config.default_db.server.{name()}" value="{text()}"/>
  97. </xsl:for-each>
  98. </xsl:template>
  99. </xsl:stylesheet>