p5ant.create_new_WPS_Function.xsl 7.6 KB

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