BI_audit.ENERGA_RUM_UMOWY.analys.xsl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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:p5ba="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/BI_audit/p5ba.xsd"
  5. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6. exclude-result-prefixes="xs"
  7. version="2.0">
  8. <xsl:output indent="yes"/>
  9. <xsl:strip-space elements="*"/>
  10. <xsl:param name="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy.uniq.slashes.root" select="'3'"/> <!-- ENSA/2017/00119/Z/2 - is ENSA/2017/00119 -->
  11. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY" match="SES_USERS2">
  12. <topic id="BI_audit_ENERGA_RUM_UMOWY_error" xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
  13. <title>Analiza zawartosci danych umów </title>
  14. <body>
  15. <!--<section id="puste_pola">
  16. <title>Puste pola </title>
  17. <xsl:apply-templates mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.empty" select="custom"/>
  18. </section>-->
  19. <section id="nr_rejestrowy">
  20. <title>Zależne dokumenty do głównego numeru rejestrowego</title>
  21. <xsl:apply-templates mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy" select="custom"/>
  22. </section>
  23. </body>
  24. </topic>
  25. </xsl:template>
  26. <xsl:function name="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy.uniq">
  27. <xsl:param name="Numer_rejestrowy"/>
  28. <xsl:variable name="out">
  29. <xsl:for-each select="tokenize($Numer_rejestrowy,'/')[ position() &lt;= number($p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy.uniq.slashes.root) ]">
  30. <xsl:text>/</xsl:text><xsl:value-of select="."/>
  31. </xsl:for-each>
  32. </xsl:variable>
  33. <xsl:value-of select="$out"/>
  34. <!--<xsl:value-of select="tokenize($Numer_rejestrowy,'/')[ position() &lt;= number($p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy.uniq.slashes.root) ]"/>-->
  35. </xsl:function>
  36. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy" match="custom">
  37. <!--<p5ba:BI_audit_ENERGA_RUM_UMOWY.db.empty>-->
  38. <xsl:comment>#30 </xsl:comment>
  39. <xsl:for-each-group select="row [ position() &lt; 100000000 ]" group-by="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy.uniq(Numer_rejestrowy)">
  40. <xsl:if test="count(current-group()) &gt; 1 ">
  41. <sectiondiv>Dla Numer rejestrowy <xsl:value-of select="current-grouping-key()"/> , wpisów <xsl:value-of select="count(current-group())"/></sectiondiv>
  42. <!--<xsl:attribute name="dla_pustego_pola" select="current-grouping-key()"/>-->
  43. <row>
  44. <xsl:apply-templates mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy.values" select="current-group()"/>
  45. </row>
  46. </xsl:if>
  47. </xsl:for-each-group>
  48. <!--</p5ba:BI_audit_ENERGA_RUM_UMOWY.db.empty>-->
  49. </xsl:template>
  50. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.empty" match="custom">
  51. <!--<p5ba:BI_audit_ENERGA_RUM_UMOWY.db.empty>-->
  52. <xsl:comment>#30 </xsl:comment>
  53. <xsl:for-each-group select="row/*[text()='' or not(text())]" group-by="local-name()">
  54. <sectiondiv>Dla pola <xsl:value-of select="current-grouping-key()"/> </sectiondiv>
  55. <!--<xsl:attribute name="dla_pustego_pola" select="current-grouping-key()"/>-->
  56. <!--<xsl:comment>#33 p5ba:BI_audit_ENERGA_RUM_UMOWY.dita.field parent::*[ position() &lt; 2]</xsl:comment>-->
  57. <xsl:apply-templates mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.dita.field" select="parent::*[ position() &lt; 1]"/>
  58. <!--<xsl:copy-of select="parent::*[ position() &lt; 2]"/>-->
  59. <!--<xsl:comment>#36 p5ba:BI_audit_ENERGA_RUM_UMOWY.dita.field .[position() &lt; 10]</xsl:comment>-->
  60. <xsl:for-each select=".[position() &lt; 10]">
  61. <xsl:apply-templates mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.dita.field"/>
  62. </xsl:for-each>
  63. </xsl:for-each-group>
  64. <!--</p5ba:BI_audit_ENERGA_RUM_UMOWY.db.empty>-->
  65. </xsl:template>
  66. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy.values" match="*"/>
  67. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy.values" match="ID|Tytul_dokumentu|Numer_sprawy|Status_sprawy|Strony_umowy|Numer_rejestrowy">
  68. <xsl:copy-of select="."/>
  69. </xsl:template>
  70. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.db.nr_rejestrowy.values" match="row">
  71. <row>
  72. <xsl:apply-templates mode="#current"/>
  73. </row>
  74. </xsl:template>
  75. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY p5ba:BI_audit_ENERGA_RUM_UMOWY.db.empty" match="*|text()|comment()"/>
  76. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.dita.field" match="A_STATUS_INFO|A_CLASSIFIED|A_ADM_COMPANY |A_STATUS|A_RECORD_CREATE_DATE|A_RECORD_CREATE_AUTHOR|A_RECORD_UPDATE_DATE|A_RECORD_UPDATE_AUTHOR|L_APPOITMENT_DATE|L_APPOITMENT_USER|L_APPOITMENT_PERIOD|L_APPOITMENT_INFO|L_APPOITMENT_TYPE|CRC|GUID|SYNC_SQIX_STATUS"/>
  77. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.dita.field" match="row">
  78. <lq>
  79. <xsl:apply-templates mode="#current"/>
  80. </lq>
  81. </xsl:template>
  82. <xsl:template mode="p5ba:BI_audit_ENERGA_RUM_UMOWY.dita.field" match="*">
  83. <ol>
  84. <li>
  85. Pole: <xsl:value-of select="local-name()"/>
  86. </li>
  87. <li>
  88. Wartosc: <xsl:value-of select="text()"/>
  89. </li>
  90. </ol>
  91. </xsl:template>
  92. </xsl:stylesheet>