p5dkp.nodes.path.add.xsl 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:p5bws="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/WPS_Functions.xsd"
  5. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  6. xmlns:p5dkp="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/dita_kosztorys_projektowy/p5dkp.xsd"
  7. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  8. xmlns:p5suis="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd"
  9. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  10. xmlns:p5xsda="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsd_asserts/p5xsda.xsd"
  11. exclude-result-prefixes="xs"
  12. version="2.0">
  13. <xsl:output indent="yes"/>
  14. <xsl:strip-space elements="*"/>
  15. <xsl:function name="p5dkp:nodes.path.add">
  16. <xsl:param name="p5dkp:nodes.path"/>
  17. <xsl:param name="p5dkp:node_no"/><!-- like etap_no -->
  18. <!--<xsl:param name="p5dkp:id"/>--> <!-- like etap.przygotowania.etap_no -->
  19. <xsl:message>#90 $p5dkp:node_no name()=<xsl:value-of select="$p5dkp:node_no/name()"/> ; @* <xsl:copy-of select="$p5dkp:node_no/@*"></xsl:copy-of></xsl:message>
  20. <!-- Dodawanie sciezek relacyjnie jak sie poruszamy w miare czytania mapy -->
  21. <xsl:variable name="p5dkp:nodes.path.var">
  22. <p5dkp:nodes.path>
  23. <xsl:choose>
  24. <xsl:when test="$p5dkp:nodes.path">
  25. <xsl:for-each select="$p5dkp:nodes.path/p5dkp:nodes.path/*">
  26. <xsl:copy-of select="."/>
  27. </xsl:for-each>
  28. </xsl:when>
  29. <xsl:otherwise>
  30. <xsl:message>#122 WARNING not test=$p5dkp:nodes.path </xsl:message>
  31. </xsl:otherwise>
  32. </xsl:choose>
  33. <xsl:choose>
  34. <xsl:when test="$p5dkp:node_no">
  35. <xsl:copy-of select="$p5dkp:node_no"/>
  36. </xsl:when>
  37. <xsl:otherwise>
  38. <xsl:message>#103 ERROR not expected $p5dkp:node_no name()=<xsl:value-of select="$p5dkp:node_no/name()"/> for <xsl:copy-of select="$p5dkp:node_no/@*"/></xsl:message>
  39. </xsl:otherwise>
  40. </xsl:choose>
  41. </p5dkp:nodes.path>
  42. </xsl:variable>
  43. <xsl:message>#135 p5dkp:nodes.path has count()=<xsl:value-of select="count($p5dkp:nodes.path.var//*)"/></xsl:message>
  44. <xsl:copy-of select="$p5dkp:nodes.path.var"/>
  45. </xsl:function>
  46. <xsl:function name="p5dkp:nodes.path.add">
  47. <xsl:param name="p5dkp:nodes.path"/>
  48. <xsl:param name="p5dkp:node_no"/><!-- like etap_no -->
  49. <xsl:param name="p5dkp:element"/>
  50. <!--<xsl:param name="p5dkp:id"/>--> <!-- like etap.przygotowania.etap_no -->
  51. <xsl:message>#90 $p5dkp:node_no name()=<xsl:value-of select="$p5dkp:node_no/name()"/> ; @* <xsl:copy-of select="$p5dkp:node_no/@*"></xsl:copy-of></xsl:message>
  52. <xsl:variable name="p5dkp:nodes.path.var">
  53. <p5dkp:nodes.path>
  54. <xsl:choose>
  55. <xsl:when test="$p5dkp:nodes.path">
  56. <xsl:for-each select="$p5dkp:nodes.path/p5dkp:nodes.path/*">
  57. <xsl:copy-of select="."/>
  58. </xsl:for-each>
  59. </xsl:when>
  60. <xsl:otherwise>
  61. <xsl:message>#122 WARNING not test=$p5dkp:nodes.path </xsl:message>
  62. </xsl:otherwise>
  63. </xsl:choose>
  64. <xsl:choose>
  65. <xsl:when test="$p5dkp:node_no">
  66. <xsl:for-each select="$p5dkp:node_no">
  67. <xsl:copy>
  68. <xsl:copy-of select="@*"/>
  69. <xsl:attribute name="p5dkp:element" select="$p5dkp:element"/>
  70. </xsl:copy>
  71. </xsl:for-each>
  72. </xsl:when>
  73. <xsl:otherwise>
  74. <xsl:message>#103 ERROR not expected $p5dkp:node_no name()=<xsl:value-of select="$p5dkp:node_no/name()"/> for <xsl:copy-of select="$p5dkp:node_no/@*"/></xsl:message>
  75. </xsl:otherwise>
  76. </xsl:choose>
  77. </p5dkp:nodes.path>
  78. </xsl:variable>
  79. <xsl:message>#135 p5dkp:nodes.path has count()=<xsl:value-of select="count($p5dkp:nodes.path.var//*)"/></xsl:message>
  80. <xsl:copy-of select="$p5dkp:nodes.path.var"/>
  81. </xsl:function>
  82. </xsl:stylesheet>