xp5r.testing.xsl 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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:xp5r="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/xinclude_p5_recurse/xinclude_p5_recurse.xsd"
  6. exclude-result-prefixes="xs"
  7. version="2.0">
  8. <xsl:output indent="yes" />
  9. <xsl:strip-space elements="*"/>
  10. <xsl:include href="../../build_SE_basedir/build_SE.properties.xml.xsl"/>
  11. <xsl:include href="../system_cache__appinfo/escape_functions.xsl"/>
  12. <xsl:import-schema namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/xinclude_p5_recurse/xinclude_p5_recurse.xsd" schema-location="xinclude_p5_recurse.xsd"/>
  13. <xsl:include href="../system_cache__appinfo/basedir.xsl"/><!-- for <xsl:param name="basedir" required="yes"/> -->
  14. <xsl:include href="../system_cache__appinfo/default_db.instance.xml.xsl"/> <!-- for param name="default_db.instance.xml" required="yes" file:/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/default_db.instance.xml/ -->
  15. <xsl:param name="xp5r:xinclude_p5_recurse.cache_dir" select="concat($default_db.instance.xml,'/xinclude_p5_recurse/')"/>
  16. <xsl:template match="xp5r:cache" mode="xp5r:verify"/><!-- Todo to verify integrity -->
  17. <xsl:template match="xp5r:cache" >
  18. <xp5r:cache>
  19. <xsl:attribute name="mode" select="'default'"/>
  20. <xsl:variable name="xp5r:cache_dir"> <!-- to detect params to save or read -->
  21. <xsl:apply-templates mode="xp5r:cache_dir" select="."/>
  22. </xsl:variable>
  23. <xsl:choose>
  24. <xsl:when test=" doc-available($xp5r:cache_dir)">
  25. <xsl:message>#47-A $xp5r:cache_dir aviable at <xsl:value-of select="$xp5r:cache_dir"/></xsl:message>
  26. <xsl:comment>
  27. #47-A $xp5r:cache_dir aviable at <xsl:value-of select="$xp5r:cache_dir"/></xsl:comment>
  28. <xsl:copy-of select="doc($xp5r:cache_dir)"/>
  29. </xsl:when>
  30. <xsl:otherwise>
  31. <xsl:message>#47-B $xp5r:cache_dir NOT aviable at <xsl:value-of select="$xp5r:cache_dir"/></xsl:message>
  32. <xsl:comment>
  33. #47-B $xp5r:cache_dir NOT aviable at <xsl:value-of select="$xp5r:cache_dir"/></xsl:comment>
  34. TODO to generate xslt to evaluate this cache and make ant build - paraller?
  35. </xsl:otherwise>
  36. </xsl:choose>
  37. </xp5r:cache>
  38. </xsl:template><!-- Todo to read normally data as regular file -->
  39. <xsl:template match="xp5r:cache" mode="xp5r:stylecheet_compile_for_build"> <!-- to analyze stylesheet and compile it to be executed by ANT with params based on build_SE.properties.xml.xsl -->
  40. <xsl:variable name="stylesheet.doc" select=""/>
  41. </xsl:template>
  42. <xsl:template match="xsl:stylesheet" mode="xp5r:xslt.params"/> <!-- to parse stylesheets relations to retrieve expected params to make ant build to postprocess -->
  43. <!--<xsl:function name="xp5r:cache_dir">
  44. <xsl:param name="xp5r:apply-template.mode"/>
  45. <xsl:param name="xp5r:id"/>
  46. <xsl:param name="xp5r:basedir"/>
  47. </xsl:function>-->
  48. <xsl:template mode="xp5r:cache_dir" match="xp5r:cache">
  49. <xsl:value-of select="$xp5r:xinclude_p5_recurse.cache_dir"/>
  50. <xsl:value-of select="system_cache__appinfo:translate_object_escaped_prefix_from_string(xp5r:apply-template/@mode)"/>
  51. <xsl:value-of select="system_cache__appinfo:translate_object_escaped_prefix_from_string(xp5r:apply-template/@name)"/>
  52. <xsl:value-of select="'/'"/><xsl:value-of select="@xp5r:id"/>
  53. <xsl:apply-templates mode="xp5r:cache_dir"/>
  54. </xsl:template>
  55. <xsl:template mode="xp5r:cache_dir" match="xp5r:apply-template">
  56. <xsl:apply-templates mode="xp5r:cache_dir"/>
  57. </xsl:template>
  58. <xsl:template mode="xp5r:cache_dir" match="xp5r:context-node">
  59. <xsl:apply-templates mode="xp5r:cache_dir" select="@*"/>
  60. </xsl:template>
  61. <xsl:template mode="xp5r:cache_dir" match="xp5r:with-param">
  62. <xsl:apply-templates mode="xp5r:cache_dir" select="@*"/>
  63. <xsl:if test="text()">
  64. <xsl:value-of select="system_cache__appinfo:escape_object_prefix_to_string(substring(text(),1,10))"/>
  65. </xsl:if>
  66. </xsl:template>
  67. <xsl:template match="@*" mode="xp5r:cache_dir">
  68. <xsl:value-of select="system_cache__appinfo:translate_object_escaped_prefix_from_string(name())"/>
  69. </xsl:template>
  70. <!-- to create instance of xp5r:cache in some xml templates @2018-01-01 -EOF -->
  71. <!-- <xsl:template match="apply-template" mode="xp5r:cache" xpath-default-namespace="http://www.w3.org/1999/XSL/Transform">
  72. <xp5r:cache xp5r:id="{generate-id(../.)}" xp5r:basedir=".">
  73. <xp5r:apply-template mode="system_cache__appinfo:build_flat_schema">
  74. <xsl:apply-templates mode="xp5r:cache" select="@*"/>
  75. <xsl:apply-templates mode="xp5r:cache"/>
  76. </xp5r:apply-template>
  77. </xp5r:cache>
  78. </xsl:template>
  79. <xsl:template match="select" mode="xp5r:cache"> <!-\- if select is given -\->
  80. <xsl:copy-of select="."/>
  81. </xsl:template>
  82. <xsl:template match="context-node" mode="xp5r:cache"> <!-\- if select is given -\->
  83. <xsl:copy-of select="."/>
  84. </xsl:template>
  85. <xsl:template match="with-param" mode="xp5r:cache" xpath-default-namespace="http://www.w3.org/1999/XSL/Transform">
  86. <xp5r:with-param>
  87. <xsl:apply-templates mode="xp5r:cache" select="@*"/>
  88. <xsl:apply-templates mode="xp5r:cache.with-param"/>
  89. </xp5r:with-param>
  90. </xsl:template>
  91. <xsl:template match="node()" mode="xp5r:cache.with-param">
  92. <xsl:copy-of select="node()"/>
  93. </xsl:template>
  94. <xsl:template match="@mode|@name" mode="xp5r:cache" xpath-default-namespace="http://www.w3.org/1999/XSL/Transform">
  95. <xsl:copy-of select="."/>
  96. </xsl:template>
  97. <xsl:template match="@*" mode="xp5r:cache" xpath-default-namespace="http://www.w3.org/1999/XSL/Transform"/>
  98. -->
  99. <!-- -EOF to create instance of xp5r:cache in some xml templates @2018-01-01 -->
  100. </xsl:stylesheet>