p5ant.create_new_WPS_Function.xsl 6.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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: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" -->
  51. <xsl:element name="project" inherit-namespaces="yes" >
  52. <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')"/>
  53. <xsl:namespace name="p5xsl" select="'http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd'"/>
  54. <!--<xsl:namespace name="test" select="concat('http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/',$p5ant.WPS_Functions.PRODUCT.name.input,'.xsd')"/>-->
  55. <xsl:copy-of select="@*"/>
  56. <xsl:apply-templates mode="p5ant:create_new_WPS_Function.project"/>
  57. <target name="p5xsls.xml" depends="basedir" xsl:exclude-result-prefixes="#all">
  58. <description>
  59. TODO to be fixed by xslt to allow dynamic create of multi include xsl templates
  60. </description>
  61. <echoxml namespacepolicy="elementsOnly">
  62. <xsl:attribute name="file">
  63. <xsl:text>${</xsl:text><xsl:value-of select="$p5ant.WPS_Functions.PRODUCT.prefix.input"/><xsl:text>.include.xsl.p5xsls.xml}</xsl:text>
  64. </xsl:attribute>
  65. <stylesheet_buildlist xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd">
  66. <namespaces.list xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd">
  67. <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"/>
  68. </namespaces.list>
  69. <include.list xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd">
  70. <include.list.href href="{$p5ant.xsl}" xmlns="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd"/>
  71. </include.list>
  72. </stylesheet_buildlist>
  73. </echoxml>
  74. </target>
  75. </xsl:element>
  76. </xsl:template>
  77. </xsl:stylesheet>