p5ant.create_new_WPS_Function.xsl 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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:p5ant="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd"
  5. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  6. xmlns:p5suis="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd"
  7. xmlns:p5dg="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/documentation_generator/documentation_generator.xsd"
  8. xmlns:p5xsl="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd"
  9. exclude-result-prefixes="xs"
  10. version="2.0">
  11. <xsl:output indent="yes"/>
  12. <xsl:strip-space elements="*"/>
  13. <xsl:param name="p5ant.WPS_Functions.PRODUCT.name.input" required="yes" />
  14. <xsl:param name="p5ant.WPS_Functions.PRODUCT.prefix.input" required="yes"/>
  15. <xsl:param name="p5ant.WPS_Functions.PRODUCT.module.input" />
  16. <xsl:param name="p5ant.xsl" required="yes"/>
  17. <xsl:variable name="p5ant.WPS_Functions.PRODUCT.module.input.string">
  18. <xsl:choose>
  19. <xsl:when test="$p5ant.WPS_Functions.PRODUCT.module.input">
  20. <xsl:value-of select="concat('.',$p5ant.WPS_Functions.PRODUCT.module.input)"/>
  21. </xsl:when>
  22. </xsl:choose>
  23. </xsl:variable>
  24. <xsl:template match="p5ant:project" mode="p5ant:create_new_WPS_Function.project" > <!-- xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd" -->
  25. <xsl:element name="project" inherit-namespaces="yes">
  26. <xsl:namespace name="{$p5ant.WPS_Functions.PRODUCT.prefix.input}" select="concat('http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/',$p5ant.WPS_Functions.PRODUCT.name.input,'/',$p5ant.WPS_Functions.PRODUCT.name.input,'.xsd')"/>
  27. <xsl:if test="string-length($p5ant.WPS_Functions.PRODUCT.module.input) &gt; 0"><xsl:namespace name="{$p5ant.WPS_Functions.PRODUCT.prefix.input}{$p5ant.WPS_Functions.PRODUCT.module.input.string}" select="concat('http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/',$p5ant.WPS_Functions.PRODUCT.name.input,'/',$p5ant.WPS_Functions.PRODUCT.name.input,$p5ant.WPS_Functions.PRODUCT.module.input.string,'.xsd')"/></xsl:if>
  28. <!--<xsl:namespace name="{$p5ant.WPS_Functions.PRODUCT.prefix.input}{$p5ant.WPS_Functions.PRODUCT.module.input.string}" select="concat('http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/',$p5ant.WPS_Functions.PRODUCT.name.input,'/',$p5ant.WPS_Functions.PRODUCT.prefix.input,$p5ant.WPS_Functions.PRODUCT.module.input.string,'.xsd')"/>-->
  29. <!--<xsl:namespace name="test" select="concat('http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/',$p5ant.WPS_Functions.PRODUCT.name.input,'.xsd')"/>-->
  30. <xsl:copy-of select="@*"/>
  31. <xsl:apply-templates mode="#current"/>
  32. </xsl:element>
  33. <!--<project basedir="../../." name="{$p5ant.WPS_Functions.PRODUCT.name.input}" default="default"
  34. xmlns:p5ant="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd"
  35. xmlns:p5dg="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/documentation_generator/documentation_generator.xsd"
  36. xmlns:p5bws="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/WPS_Functions.xsd"
  37. xmlns:p5xsl="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd"
  38. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  39. xmlns:p5suis="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd"
  40. >
  41. </project>-->
  42. </xsl:template>
  43. <xsl:template match="*" mode="p5ant:create_new_WPS_Function.project" > <!-- xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd" -->
  44. <xsl:variable name="namespace-uri-for-prefix" select=" namespace-uri-for-prefix(prefix-from-QName(node-name(.)),.)"/>
  45. <xsl:choose>
  46. <xsl:when test="$namespace-uri-for-prefix='http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd'">
  47. <xsl:element name="p5suis:{local-name()}" namespace="{$namespace-uri-for-prefix}">
  48. <xsl:if test="@name"><xsl:attribute name="name" select="@name"/></xsl:if>
  49. <xsl:copy-of select="@*"/>
  50. <xsl:apply-templates mode="#current"/>
  51. </xsl:element>
  52. </xsl:when>
  53. <xsl:otherwise>
  54. <xsl:element name="{local-name()}">
  55. <xsl:if test="@name"><xsl:attribute name="name" select="@name"/></xsl:if>
  56. <xsl:copy-of select="@*"/>
  57. <xsl:apply-templates mode="#current"/>
  58. </xsl:element>
  59. </xsl:otherwise>
  60. </xsl:choose>
  61. </xsl:template>
  62. <xsl:template match="p5ant.condition[@property and p5ant.isset]" mode="p5ant:create_new_WPS_Function.project" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd">
  63. <xsl:choose>
  64. <xsl:when test="p5ant.isset[contains(@property,'\$\{')]">
  65. <xsl:comment>#66 property is unset in config generation <xsl:value-of select="p5ant.isset/@property"/></xsl:comment>
  66. </xsl:when>
  67. <xsl:otherwise>
  68. <xsl:element name="property" inherit-namespaces="no">
  69. <xsl:attribute name="name" select="@property"/>
  70. <xsl:copy-of select="@location"/>
  71. <xsl:copy-of select="@value"/>
  72. </xsl:element>
  73. </xsl:otherwise>
  74. </xsl:choose>
  75. </xsl:template>
  76. <xsl:template match="p5ant.condition" mode="p5ant:create_new_WPS_Function.project" xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd">
  77. <xsl:comment>#78 incorrect expected input cond</xsl:comment>
  78. </xsl:template>
  79. <xsl:template match="p5ant:project" mode="p5ant:create_new_WPS_Function.PRODUCT" > <!-- xpath-default-namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd" -->
  80. <xsl:element name="project" inherit-namespaces="yes" >
  81. <xsl:namespace name="{$p5ant.WPS_Functions.PRODUCT.prefix.input}" select="concat('http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/',$p5ant.WPS_Functions.PRODUCT.name.input,'/',$p5ant.WPS_Functions.PRODUCT.name.input,'.xsd')"/>
  82. <xsl:if test="string-length($p5ant.WPS_Functions.PRODUCT.module.input) &gt; 0"><xsl:namespace name="{$p5ant.WPS_Functions.PRODUCT.prefix.input}{$p5ant.WPS_Functions.PRODUCT.module.input.string}" select="concat('http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/',$p5ant.WPS_Functions.PRODUCT.name.input,'/',$p5ant.WPS_Functions.PRODUCT.name.input,$p5ant.WPS_Functions.PRODUCT.module.input.string,'.xsd')"/></xsl:if>
  83. <xsl:namespace name="p5xsl" select="'http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd'"/>
  84. <!--<xsl:namespace name="test" select="concat('http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/',$p5ant.WPS_Functions.PRODUCT.name.input,'.xsd')"/>-->
  85. <xsl:copy-of select="@*"/>
  86. <xsl:apply-templates mode="p5ant:create_new_WPS_Function.project"/>
  87. <target name="p5xsls.xml" depends="basedir" xsl:exclude-result-prefixes="#all">
  88. <description>
  89. TODO to be fixed by xslt to allow dynamic create of multi include xsl templates
  90. </description>
  91. <echoxml namespacepolicy="elementsOnly">
  92. <xsl:attribute name="file">
  93. <xsl:text>${</xsl:text><xsl:value-of select="$p5ant.WPS_Functions.PRODUCT.prefix.input"/><xsl:text>.include.xsl.p5xsls.xml}</xsl:text>
  94. </xsl:attribute>
  95. <stylesheet_buildlist xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd">
  96. <namespaces.list xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd">
  97. <namespaces.list.namespace prefix="{$p5ant.WPS_Functions.PRODUCT.prefix.input}" namespace="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/{$p5ant.WPS_Functions.PRODUCT.name.input}/{$p5ant.WPS_Functions.PRODUCT.name.input}.xsd" xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd"/>
  98. </namespaces.list>
  99. <include.list xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd">
  100. <include.list.href href="{$p5ant.xsl}" xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd"/>
  101. </include.list>
  102. </stylesheet_buildlist>
  103. </echoxml>
  104. </target>
  105. </xsl:element>
  106. </xsl:template>
  107. </xsl:stylesheet>