Parcourir la source

Merge branch 'master' of bn.git:plabudda/se

Piotr Labudda il y a 7 ans
Parent
commit
4d18b290d2
23 fichiers modifiés avec 3205 ajouts et 568 suppressions
  1. 1 1
      SE/schema/WPS_Functions/bocian-graph-to-html/bcgtht.tree_to_dita.xsl
  2. 198 176
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.xsl
  3. 255 42
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl
  4. 116 0
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UKR.xsl
  5. 143 13
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_context.path.keyrefs.xsl
  6. 19 8
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_context.path.xsl
  7. 4 3
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row.xsl
  8. 37 142
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA.xsl
  9. 1 1
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.stats_all.xsl
  10. 49 15
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.xsl
  11. 99 16
      SE/schema/default_db_xml_cache.public/default_db/Linear_regression/Linear_regression.xsl
  12. 3 0
      SE/schema/default_db_xml_cache.public/default_db/big_values_format.xsl
  13. 3 1
      SE/schema/default_db_xml_cache.public/default_db/dateTime.xsl
  14. 80 37
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl
  15. 62 64
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats.xsl
  16. 68 42
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl
  17. 7 3
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl
  18. 16 1
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__detect.xsl
  19. 2 1
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__set.xsl
  20. 2 0
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.localname.translate.xsl
  21. 2 0
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita__x3A__to_merge.xsl
  22. 52 0
      SE/schema/default_db_xml_cache.public/math/sqrt.xsl
  23. 1986 2
      se.oxygen.xpr

+ 1 - 1
SE/schema/WPS_Functions/bocian-graph-to-html/bcgtht.tree_to_dita.xsl

@@ -621,7 +621,7 @@ plot "<xsl:value-of select="$fileindex"/>.gnuplot.dat" using 2:xtic(1) with boxe
       </xsl:choose>
    </xsl:function>
    
-   <xsl:template match="relation_from|BI_audit_MSIG_person[preceding-sibling::* and following-sibling::*][preceding-sibling::* and following-sibling::*]|BI_audit_KRS_person[ preceding-sibling::* and following-sibling::* ]|BI_audit_MSIG_company|BI_audit_KRS_company|BI_audit_taxpayer|TERYT_adresy|BI_audit_MSIG_address|BI_audit_KRS_address" mode="bocian-graph-2-html.preprocess.names" priority="5"/>
+   <xsl:template match="relation_DateRangeElements|relation_from|BI_audit_MSIG_person[preceding-sibling::* and following-sibling::*][preceding-sibling::* and following-sibling::*]|BI_audit_KRS_person[ preceding-sibling::* and following-sibling::* ]|BI_audit_MSIG_company|BI_audit_KRS_company|BI_audit_taxpayer|TERYT_adresy|BI_audit_MSIG_address|BI_audit_KRS_address" mode="bocian-graph-2-html.preprocess.names" priority="5"/>
    
    <xsl:template mode="bocian-graph-2-html.preprocess.names" match="ID|imiona|nazwisko|Pelna_nazwa_kontrahenta|nazwa"> <!-- |*[not(*)] -->
       <xsl:element name="default_db__x3A__{parent::*/local-name()}:{local-name()}" namespace="https://biuro.biall-net.pl/wfs/default_db/{local-name()}">

+ 198 - 176
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.xsl

@@ -199,6 +199,28 @@
                                                     <xsl:with-param name="mode" select="$mode" tunnel="yes"/>
                                                 </xsl:apply-templates>
                                             </xsl:when>
+                                            <xsl:when test="$mode = 'system_cache__dita:ANALIZA_KORELACJI_UKR'">
+                                                <!--<xsl:message>#290 debug mode <xsl:value-of select="$mode"/>; </xsl:message>-->
+                                                <xsl:apply-templates mode="system_cache__dita:ANALIZA_KORELACJI_UKR" select="." >
+                                                    <xsl:with-param name="group_name" select="$group_name"/>
+                                                    <xsl:with-param name="position" select="position()"/>
+                                                    <xsl:with-param name="resulset" select="$resulset"/>
+                                                    <xsl:with-param name="title" select="concat($title,$source)"/>
+                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField"    select="$default_db__x3A__BI_audit_BENFORD:valueField" />
+                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:groupField"     select="$default_db__x3A__BI_audit_BENFORD:groupField"/>
+                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField"   select="$default_db__x3A__BI_audit_BENFORD:timeField" />
+                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:AddressField" select="$default_db__x3A__BI_audit_BENFORD:AddressField" />
+                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"  />
+                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField"  select="$default_db__x3A__BI_audit_BENFORD:TaxIdField" />
+                                                    <xsl:with-param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed"/>
+                                                    <xsl:with-param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq"/>
+                                                    <xsl:with-param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed//fixed[@generate-id=current()/@generate-id][1]"/>
+                                                    <xsl:with-param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq.current" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq//uniq[@generate-id=current()/@generate-id][1]"/>
+                                                    <xsl:with-param name="interested_row" select="$interested_row"/>
+                                                    <xsl:with-param name="source" select="$source"/>
+                                                    <xsl:with-param name="mode" select="$mode" tunnel="yes"/>
+                                                </xsl:apply-templates>
+                                            </xsl:when>
                                             
                                             <xsl:when test="$mode = 'BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA'">
                                                     
@@ -386,6 +408,7 @@
         <xsl:param name="count"/>
         <xsl:param name="position"/>
         <xsl:param name="limit"/>
+        <xsl:param name="end_fid"/>
         
         <title>
             
@@ -484,7 +507,11 @@
         <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current" />
         <xsl:param name="system_cache__dita:element__x3A__parent" select="'p'"/>
         <xsl:param name="title" select="'Ścieżka śledzenia do '"/>
+        <xsl:param name="system_cache__dita:xref__x3A__title"/>
         <xsl:param name="count"/>
+        <xsl:param name="fid"/>
+        <xsl:param name="end_fid"/>
+        <xsl:param name="get_wfs:name_from_fid"/>
         <xsl:variable name="context" select="."/>
         <xsl:variable name="system_cache__dita:paragraph_allowed_element__x3A__calculated" select="system_cache__dita:element.next($system_cache__dita:element__x3A__parent)">
             <!--<xsl:choose>
@@ -496,12 +523,14 @@
         </xsl:variable>
         <xsl:choose>
             <xsl:when test="Numer_kontrahenta/text()|ID/text()|source/text()|jednostka_organizacyjna/text()">
-               <sup><ph>
+                <!--<sup>-->
+                   <ph>
                     <xsl:if test="Numer_kontrahenta/text()"> nr kontr: <b><xsl:value-of select="Numer_kontrahenta"/></b></xsl:if>
                     <xsl:if test="jednostka_organizacyjna/text()"> nr kontr: <b><xsl:value-of select="jednostka_organizacyjna"/></b></xsl:if>
                     <xsl:if test="ID/text()"> ID <b><xsl:value-of select="ID"/></b></xsl:if>
                     <xsl:if test="source/text()"> source <b><xsl:value-of select="source"/></b></xsl:if>
-               </ph></sup> 
+                  </ph>
+               <!--</sup>--> 
             </xsl:when>
         </xsl:choose>
         <xsl:choose>
@@ -512,107 +541,155 @@
                     <xsl:with-param name="text"/>
                     <xsl:with-param name="system_cache__dita:indexterm" select="system_cache__dita:indexterm('Ścieżka śledzenia','')"/>
                 </xsl:call-template>
-                <sup><ph>
+                <!--<sup>-->
+                <xsl:variable name="link__x3A__title">
                     <xsl:if test="nazwa/text()"> nazwa: <b><xsl:value-of select="replace(nazwa,'SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ',' (Sp. z o.o.) ')"/></b></xsl:if>
                     <xsl:if test="Pelna_nazwa_kontrahenta/text()"> nazwa : <b><xsl:value-of select="replace(Pelna_nazwa_kontrahenta,'SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ',' (Sp. z o.o.) ')"/></b></xsl:if>
-                </ph></sup>
+                </xsl:variable>
+                <xsl:choose>
+                    <xsl:when test="$system_cache__dita:xref__x3A__title or $fid">
+                        <!--<xref>-->
+                            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
+                                <xsl:with-param name="fid" select="$fid"/>
+                                <xsl:with-param name="end_fid" select="$end_fid"/>
+                                <xsl:with-param name="title" select="$system_cache__dita:xref__x3A__title"/>
+                                <xsl:with-param name="link__x3A__title"  select="$link__x3A__title"/>
+                                <xsl:with-param name="get_wfs:name_from_fid" select="$get_wfs:name_from_fid"/>
+                            </xsl:call-template>
+                            <!--<xsl:copy-of select="system_cache__dita:files.context.title.keyref(current(),$system_cache__dita:xref__x3A__title)" copy-namespaces="no"/>-->
+                            
+                        <!--</xref>-->
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <ph>
+                            <xsl:copy-of select="$link__x3A__title"></xsl:copy-of>
+                        </ph>
+                    </xsl:otherwise>
+                </xsl:choose>
+                
+                <!--</sup>-->
             </xsl:when>
         </xsl:choose>
         
         <xsl:choose>
             <xsl:when test="imiona/text()|nazwisko/text()">
-                <sup><ph>
-                    <xsl:if test="nazwisko/text()"> nazwisko: <b><xsl:value-of select="nazwisko"/></b></xsl:if>
-                    <xsl:if test="imiona/text()"> imiona: <b><xsl:value-of select="imiona"/></b></xsl:if>
-                </ph></sup>
+                <!--<sup>-->
+                <xsl:variable name="link__x3A__title">
+                    <xsl:if test="nazwisko/text()"> nazwisko <b><xsl:value-of select="nazwisko"/></b></xsl:if>
+                    <xsl:if test="imiona/text()"> imiona <b><xsl:value-of select="imiona"/></b></xsl:if>
+                </xsl:variable>
+                <xsl:choose>
+                    <xsl:when test="$system_cache__dita:xref__x3A__title or $fid">
+                        <!--<xref>-->
+                            <!--<xsl:copy-of select="system_cache__dita:files.context.title.keyref(current(),$system_cache__dita:xref__x3A__title)" copy-namespaces="no"/>-->
+                            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
+                                <xsl:with-param name="fid" select="$fid"/>
+                                <xsl:with-param name="title" select="$system_cache__dita:xref__x3A__title"/>
+                                <xsl:with-param name="link__x3A__title"  select="$link__x3A__title"/>
+                                <xsl:with-param name="end_fid" select="$end_fid"/>
+                                <xsl:with-param name="get_wfs:name_from_fid" select="$get_wfs:name_from_fid"/>
+                            </xsl:call-template>
+                        <!--</xref>-->
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <ph>
+                            <xsl:copy-of select="$link__x3A__title"/>
+                        </ph>
+                    </xsl:otherwise>
+                </xsl:choose>
+                   
+                <!--</sup>-->
             </xsl:when>
         </xsl:choose>
         
         <xsl:choose>
             <xsl:when test="pesel/text()|PESEL/text()">
-                <sup><ph>
-                    <xsl:if test="pesel/text()"> PESEL: <b><xsl:value-of select="pesel"/></b></xsl:if>
-                    <xsl:if test="PESEL/text()"> PESEL: <b><xsl:value-of select="PESEL"/></b></xsl:if>
-                </ph></sup>
+                <!--<sup>-->
+                    <ph>
+                    <xsl:if test="pesel/text()"> PESEL <b><xsl:value-of select="pesel"/></b></xsl:if>
+                    <xsl:if test="PESEL/text()"> PESEL <b><xsl:value-of select="PESEL"/></b></xsl:if>
+                    </ph>
+                <!--</sup>-->
             </xsl:when>
         </xsl:choose>
         
         <xsl:choose>
             <xsl:when test="krs/text()|regon/text()|KRS/text()|REGON/text()|NIP/text()|nip/text()">
-                <sup>
+                <!--<sup>-->
                     <ph>
-                    <xsl:if test="krs/text()"> KRS: <b><xsl:value-of select="krs"/></b></xsl:if>
-                    <xsl:if test="KRS/text()"> KRS: <b><xsl:value-of select="KRS"/></b></xsl:if>
-                    <xsl:if test="regon/text()"> REGON: <b><xsl:value-of select="regon"/></b></xsl:if>
-                    <xsl:if test="REGON/text()"> REGON: <b><xsl:value-of select="REGON"/></b></xsl:if>
-                    <xsl:if test="NIP/text()"> NIP: <b><xsl:value-of select="NIP"/></b></xsl:if>
-                    <xsl:if test="nip/text()"> NIP: <b><xsl:value-of select="nip"/></b></xsl:if>
+                    <xsl:if test="krs/text()"> KRS <b><xsl:value-of select="krs"/></b></xsl:if>
+                    <xsl:if test="KRS/text()"> KRS <b><xsl:value-of select="KRS"/></b></xsl:if>
+                    <xsl:if test="regon/text()"> REGON <b><xsl:value-of select="regon"/></b></xsl:if>
+                    <xsl:if test="REGON/text()"> REGON <b><xsl:value-of select="REGON"/></b></xsl:if>
+                    <xsl:if test="NIP/text()"> NIP <b><xsl:value-of select="NIP"/></b></xsl:if>
+                    <xsl:if test="nip/text()"> NIP <b><xsl:value-of select="nip"/></b></xsl:if>
                     
                 </ph>
-                </sup>
+                <!--</sup>-->
             </xsl:when>
         </xsl:choose>
         
         <xsl:choose>
             <xsl:when test="S_kraj/text()|S_wojewodztwo/text()">
-                <sup>
+                <!--<sup>-->
                     <ph>
-                    <xsl:if test="S_kraj/text()"> kraj: <b><xsl:value-of select="S_kraj"/></b></xsl:if>
-                    <xsl:if test="S_wojewodztwo/text()"> woj.: <b><xsl:value-of select="S_wojewodztwo"/></b></xsl:if>
+                    <xsl:if test="S_kraj/text()"> kraj <b><xsl:value-of select="S_kraj"/></b></xsl:if>
+                    <xsl:if test="S_wojewodztwo/text()"> woj. <b><xsl:value-of select="S_wojewodztwo"/></b></xsl:if>
                     
                     </ph>
-                </sup>
+                <!--</sup>-->
             </xsl:when>
         </xsl:choose>
         
         
         <xsl:choose>
             <xsl:when test="A_miejscowosc/text()|Miejscowosc/text()|A_ulica/text()|A_nrDomu/text()|ulica/text()|Numer_budynku/text()|nrLokalu/text()|Numer_mieszkania_lokalu/text()|Ulica/text()">
-                <sup>
+                <!--<sup>-->
                     <ph>
-                    <xsl:if test="A_miejscowosc/text()"> msc.: <b><xsl:value-of select="A_miejscowosc"/></b></xsl:if>
-                    <xsl:if test="Miejscowosc/text()"> msc.: <b><xsl:value-of select="Miejscowosc"/></b></xsl:if>
-                    <xsl:if test="A_ulica/text()"> ul.: <b><xsl:value-of select="A_ulica"/></b></xsl:if>
-                    <xsl:if test="ulica/text()"> ul.: <b><xsl:value-of select="ulica"/></b></xsl:if>
-                    <xsl:if test="Ulica/text()"> ul.: <b><xsl:value-of select="Ulica"/></b></xsl:if>
-                    <xsl:if test="A_nrDomu/text()"> dom: <b><xsl:value-of select="A_nrDomu"/></b></xsl:if>
-                    <xsl:if test="Numer_budynku/text()"> dom: <b><xsl:value-of select="Numer_budynku"/></b></xsl:if>
-                    <xsl:if test="nrLokalu/text()"> lok.: <b><xsl:value-of select="nrLokalu"/></b></xsl:if>
-                    <xsl:if test="A_nrLokalu/text()"> lok.: <b><xsl:value-of select="A_nrLokalu"/></b></xsl:if>
+                    <xsl:if test="A_miejscowosc/text()"> m. <b><xsl:value-of select="A_miejscowosc"/></b></xsl:if>
+                    <xsl:if test="Miejscowosc/text()"> m. <b><xsl:value-of select="Miejscowosc"/></b></xsl:if>
+                    <xsl:if test="A_ulica/text()"> ul. <b><xsl:value-of select="A_ulica"/></b></xsl:if>
+                    <xsl:if test="ulica/text()"> ul. <b><xsl:value-of select="ulica"/></b></xsl:if>
+                    <xsl:if test="Ulica/text()"> ul. <b><xsl:value-of select="Ulica"/></b></xsl:if>
+                    <xsl:if test="A_nrDomu/text()"> dom <b><xsl:value-of select="A_nrDomu"/></b></xsl:if>
+                    <xsl:if test="Numer_budynku/text()"> dom <b><xsl:value-of select="Numer_budynku"/></b></xsl:if>
+                    <xsl:if test="nrLokalu/text()"> lok. <b><xsl:value-of select="nrLokalu"/></b></xsl:if>
+                    <xsl:if test="A_nrLokalu/text()"> lok. <b><xsl:value-of select="A_nrLokalu"/></b></xsl:if>
                     
-                    <xsl:if test="Numer_mieszkania_lokalu/text()"> lok.: <b><xsl:value-of select="Numer_mieszkania_lokalu"/></b></xsl:if>
-                    
-                </ph>
-                </sup>
+                    <xsl:if test="Numer_mieszkania_lokalu/text()"> lok. <b><xsl:value-of select="Numer_mieszkania_lokalu"/></b></xsl:if>
+                    </ph>
+                <!--</sup>-->
             </xsl:when>
         </xsl:choose>
         
         <xsl:choose>
             <xsl:when test="A_poczta/text()|kodPocztowy/text()|A_kod/text()">
-                <sup>
+                <!--<sup>-->
                     <ph>
-                    <xsl:if test="A_poczta/text()"> poczta: <b><xsl:value-of select="A_poczta"/></b></xsl:if>
-                    <xsl:if test="kodPocztowy/text()"> kod: <b><xsl:value-of select="kodPocztowy"/></b></xsl:if>
-                    <xsl:if test="A_kod/text()"> kod: <b><xsl:value-of select="A_kod"/></b></xsl:if>
+                    <xsl:if test="A_poczta/text()"> poczta <b><xsl:value-of select="A_poczta"/></b></xsl:if>
+                    <xsl:if test="kodPocztowy/text()"> kod <b><xsl:value-of select="kodPocztowy"/></b></xsl:if>
+                    <xsl:if test="A_kod/text()"> kod <b><xsl:value-of select="A_kod"/></b></xsl:if>
                     </ph>
-                </sup>
+                <!--</sup>-->
             </xsl:when>
         </xsl:choose>
         
         <xsl:choose>
             <xsl:when test="BI_audit_ENERGA_PRACOWNICY_adresy/*">
                 <xsl:for-each select="BI_audit_ENERGA_PRACOWNICY_adresy">
-                    <p><sup>
+                    <p>
+                      <!--<sup>-->
                         <xsl:choose>
                             <xsl:when test="last() &gt; 0"><i> adres nr <xsl:value-of select="position()"/>/<xsl:value-of select="last()"/></i></xsl:when>
                         </xsl:choose>
                         
-                        <xsl:if test="kodPocztowy/text()"> kod: <b><xsl:value-of select="kodPocztowy"/></b> </xsl:if>
-                        <xsl:if test="miejscowosc/text()"> msc.: <b><xsl:value-of select="miejscowosc"/></b> </xsl:if>
-                        <xsl:if test="ulica/text()"> ul.: <b><xsl:value-of select="ulica"/></b> </xsl:if>
-                        <xsl:if test="nrBudynku/text()"> dom: <b><xsl:value-of select="nrBudynku"/></b> </xsl:if>
-                        <xsl:if test="nrLokalu/text()"> lok.: <b><xsl:value-of select="nrLokalu"/></b> </xsl:if>
-                    </sup></p>
+                        <xsl:if test="kodPocztowy/text()"> kod <b><xsl:value-of select="kodPocztowy"/></b></xsl:if>
+                        <xsl:if test="miejscowosc/text()"> m. <b><xsl:value-of select="miejscowosc"/></b></xsl:if>
+                        <xsl:if test="ulica/text()"> ul. <b><xsl:value-of select="ulica"/></b></xsl:if>
+                        <xsl:if test="nrBudynku/text()"> dom <b><xsl:value-of select="nrBudynku"/></b></xsl:if>
+                        <xsl:if test="nrLokalu/text()"> lok. <b><xsl:value-of select="nrLokalu"/></b></xsl:if>
+                        <!--</sup>-->
+                    </p>
                 </xsl:for-each>
             </xsl:when>
         </xsl:choose>
@@ -620,23 +697,23 @@
         <xsl:choose>
             <xsl:when test="TERYT_names/*">
                 <xsl:for-each select="TERYT_names">
-                    <xsl:element name="{$system_cache__dita:paragraph_allowed_element__x3A__calculated}">
+                    <xsl:element name="ph">
                     
-                        <sup>
+                        <ph>
                         <xsl:choose>
-                            <xsl:when test="last() &gt; 0"><i> teryt. adres: </i></xsl:when>
+                            <xsl:when test="last() &gt; 0"><i> TERYT adres: </i></xsl:when>
                         </xsl:choose>
                         
-                        <xsl:if test="wojewodztwo/text()"> woj.: <b><xsl:value-of select="wojewodztwo"/></b> </xsl:if>
-                        <xsl:if test="powiat/text()"> pow.: <b><xsl:value-of select="powiat"/></b> </xsl:if>
-                        <xsl:if test="gmina/text()"> gm.: <b><xsl:value-of select="gmina"/></b> </xsl:if>
-                        <xsl:if test="miejscowosc/text()"> msc.: <b><xsl:value-of select="miejscowosc"/></b> </xsl:if>
-                        <xsl:if test="ulica_cecha/text()"><i><xsl:value-of select="ulica_cecha"/>:</i> </xsl:if>
-                        <xsl:if test="ulica_nazwa_1/text()"> <b><xsl:value-of select="ulica_nazwa_1"/></b> </xsl:if>
-                        <xsl:if test="ulica_nazwa_2/text()"> <b><xsl:value-of select="ulica_nazwa_2"/></b> </xsl:if>
-                        <xsl:if test="$context/nrDomu/text()"> dom: <b><xsl:value-of select="$context/nrDomu"/></b> </xsl:if>
-                        <xsl:if test="$context/nrLokalu/text()"> lok.: <b><xsl:value-of select="$context/nrLokalu"/></b> </xsl:if>
-                    </sup>
+                        <xsl:if test="wojewodztwo/text()"> woj. <b><xsl:value-of select="wojewodztwo"/></b></xsl:if>
+                        <xsl:if test="powiat/text()"> pow. <b><xsl:value-of select="powiat"/></b></xsl:if>
+                        <xsl:if test="gmina/text()"> gm. <b><xsl:value-of select="gmina"/></b></xsl:if>
+                        <xsl:if test="miejscowosc/text()"> m. <b><xsl:value-of select="miejscowosc"/></b></xsl:if>
+                        <xsl:if test="ulica_cecha/text()"> <i><xsl:value-of select="ulica_cecha"/></i></xsl:if>
+                        <xsl:if test="ulica_nazwa_1/text()"> <b><xsl:value-of select="ulica_nazwa_1"/></b></xsl:if>
+                        <xsl:if test="ulica_nazwa_2/text()"> <b><xsl:value-of select="ulica_nazwa_2"/></b></xsl:if>
+                        <xsl:if test="$context/nrDomu/text()"> dom <b><xsl:value-of select="$context/nrDomu"/></b></xsl:if>
+                        <xsl:if test="$context/nrLokalu/text()"> lok. <b><xsl:value-of select="$context/nrLokalu"/></b></xsl:if>
+                    </ph>
                     
                     </xsl:element>
                 </xsl:for-each>
@@ -644,37 +721,10 @@
         </xsl:choose>
         <xsl:choose>
             <xsl:when test="BI_audit_taxpayer   or $context/BI_audit_taxpayer">
-                <xsl:element name="{$system_cache__dita:paragraph_allowed_element__x3A__calculated}">
-                
-                    <!--<dl>-->
-                        <!--<dlentry>-->
-                            <!--<dt>-->
-                                <sup>Status VAT:</sup>
-                            <!--</dt>-->
-                            <!--<dd>-->
-                                <!--<sup><xsl:value-of select="BI_audit_taxpayer/taxpayer_status"/></sup>-->
-                            <!--</dd>-->
-                        <!--</dlentry>-->
-                        <!--<dlentry>-->
-                            <!--<dt>-->
-                                <!--<sup>informacja</sup>-->
-                            <!--</dt>-->
-                            <!--<dd>-->
-                    <sup><b><xsl:value-of select="BI_audit_taxpayer/taxpayer_status_info"/></b></sup>
-                            <!--</dd>-->
-                        <!--</dlentry>-->
-                        <!--<dlentry>-->
-                            <!--<dt>-->
-                                <sup>(stan na dzień</sup>
-                            <!--</dt>-->
-                            <!--<dd>-->
-                                <sup><xsl:value-of select="BI_audit_taxpayer/taxpayer_status_date"/>)</sup>
-                            <!--</dd>-->
-                        <!--</dlentry>-->
-                    <!--</dl>-->
-                
+                <ph>
+                    <ph>Status VAT: <b><xsl:value-of select="BI_audit_taxpayer/taxpayer_status_info"/></b> (stan na dzień <b><xsl:value-of select="BI_audit_taxpayer/taxpayer_status_date"/></b>)</ph>
+                </ph>
                 
-                </xsl:element>
             </xsl:when>
         </xsl:choose>
         
@@ -689,10 +739,10 @@
         <simpletable frame="all" relcolwidth="1* 2* 2* 4*" id="{$uuid}__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.last.table_{system_cache__dita:files.topic.table.id('',@fid)}_path_{generate-id()}">
             <xsl:attribute name="props">mode__universal.last.table</xsl:attribute>
             <strow>
-                <stentry><sup>Lp</sup></stentry>
-                <stentry><sup>Sposób wyszukania</sup></stentry>
-                <stentry><sup>Rejestr</sup></stentry>
-                <stentry><sup>Dane z rejestru</sup></stentry>
+                <stentry><ph>Lp</ph></stentry>
+                <stentry><ph>Sposób wyszukania</ph></stentry>
+                <stentry><ph>Rejestr</ph></stentry>
+                <stentry><ph>Dane z rejestru</ph></stentry>
             </strow>
             <xsl:for-each select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object">
                 <strow>
@@ -702,13 +752,13 @@
                         
                         <xsl:choose>
                             <xsl:when test="relation_from/text()">
-                                <sup><xsl:value-of select="system_cache__dita:localname.translate(relation_from)"/></sup>
+                                <ph><b><xsl:value-of select="system_cache__dita:localname.translate(relation_from)"/></b></ph>
                             </xsl:when>
                             <xsl:when test="position() = 1">
-                                <sup>wybrany początkowy obiekt </sup>
+                                <ph>wybrany początkowy obiekt </ph>
                             </xsl:when>
                             <xsl:otherwise>
-                                <sup>inny</sup>
+                                <ph>inny</ph>
                             </xsl:otherwise>
                         </xsl:choose>
                         <xsl:choose>
@@ -716,55 +766,41 @@
                                 
                                     
                                 
-                                <dl>
-                                    <dlentry>
-                                    <dt/>
-                                        
-                                        <dt>Relacja w czasie</dt>
+                                <p>
+                                    <ph>Relacja w czasie: </ph>
+                                </p>
+                                
+                                <xsl:for-each select="relation_DateRangeElements">
+                                    <p>
+                                        <ph>
                                     <xsl:choose>
-                                        <xsl:when test="relation_DateRangeElements/@leadingTimeDate-From">
-                                            <dd>
-                                                od dnia <xsl:value-of select="relation_DateRangeElements/@leadingTimeDate-From"/>
-                                            </dd>
+                                        <xsl:when test="@leadingTimeDate-From">
+                                            od <b><xsl:value-of select="@leadingTimeDate-From"/></b>
                                         </xsl:when>
                                     </xsl:choose>
                                     <xsl:choose>
-                                        <xsl:when test="relation_DateRangeElements/@leadingTimeDate-To">
+                                        <xsl:when test="@leadingTimeDate-To">
                                             <xsl:choose>
-                                                <xsl:when test="string-length(relation_DateRangeElements/@leadingTimeDate-To) &gt;0">
-                                                    <dd>
-                                                        do <xsl:value-of select="relation_DateRangeElements/@leadingTimeDate-To"/>
-                                                    </dd>
+                                                <xsl:when test="string-length(@leadingTimeDate-To) &gt;0">
+                                                    do <b><xsl:value-of select="@leadingTimeDate-To"/></b>
                                                 </xsl:when>
                                                 <xsl:otherwise>
-                                                    <dd>
-                                                        n. określ.
-                                                    </dd>
+                                                    do <b>teraz</b>
                                                 </xsl:otherwise>
                                             </xsl:choose>
                                             
-                                            
-                                            
                                         </xsl:when>
                                     </xsl:choose>
-                                    </dlentry>
-                                </dl>
+                                        </ph>
+                                    </p>
+                                </xsl:for-each>
                                 
                                 
                             </xsl:when>
                             
                             
                         </xsl:choose>
-                        <!--<foreign>
-                            
-                            <ph>
-                                <!-\-<xsl:for-each select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@*">
-                                    <xsl:value-of select="name()"/> = <xsl:value-of select="."/> <xsl:text> </xsl:text>
-                                </xsl:for-each>-\->
-                            </ph>
-                            
-                            <!-\-<xsl:value-of select="$foreign_fallback.current_topic_id"/>-\->
-                        </foreign>-->
+                        
                         <xsl:if test="position() = last()">
                         <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
                             <xsl:with-param name="fid"  select="parent::*//*[last()]/*[1]/@fid"/>
@@ -777,66 +813,52 @@
                         </xsl:if>
                     </stentry>
                     <stentry>
-                        <sup><xsl:value-of select="*[1]/system_cache__dita:localname.translate(local-name())"/></sup>
+                        <ph><xsl:value-of select="*[1]/system_cache__dita:localname.translate(local-name())"/></ph>
                     </stentry>
                     <stentry>
-                        <p>
-                        <xref>
+                        <p props="last">
+                        <!--<xref>
                             <xsl:copy-of select="system_cache__dita:files.context.title.keyref(*[1],'BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA')" copy-namespaces="no"/>
-                            link
-                        </xref>
+                        </xref>-->
                           
                           
                           
                         </p>
-                        <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body"/>
-                     <!--   <xsl:variable name="system_cache__dita:localname.translate">
-                            <system_cache__dita:localname.translate>-->
-                            <!--<xsl:for-each select="*[1]/*[ not(*)]">
-                                <!-\-<xsl:choose>
-                                    <xsl:when test="system_cache__dita:localname.translate(current()/name())/comment()='A_ADM'"> ( A_ADM ) </xsl:when>
-                                    <xsl:when test="system_cache__dita:localname.translate(current()/name())/comment()='DEBUG'"> ( DEBUG ) </xsl:when>
-                                    <xsl:when test="system_cache__dita:localname.translate(current()/name())/comment()='NAME'"> ( NAME ) </xsl:when>
-                                    <xsl:when test="system_cache__dita:localname.translate(current()/name())/comment()='ID_DOC'"> ( ID_DOC ) </xsl:when>
-                                </xsl:choose>-\->
-                                <p> <xsl:value-of select="system_cache__dita:localname.translate(current()/name())/text()"/> <xsl:text> </xsl:text><xsl:value-of select="."/></p>
-                            </xsl:for-each>-->
-                            <!--</system_cache__dita:localname.translate>
-                        </xsl:variable>-->
-                        
-                        <!--<xsl:for-each-group select="$system_cache__dita:localname.translate/system_cache__dita:localname.translate/p[ not(contains(comment(),'A_ADM')) and not(contains(comment(),'L_APP'))  and not(contains(comment(),'DEBUG'))]" group-by="comment()">
-                            <p>
-                                <xsl:copy-of select="current-group()"/>
-                            </p>
-                        </xsl:for-each-group>-->
-                        <xsl:comment>#188</xsl:comment>
-                        <!--<xsl:choose>
-                            <xsl:when test="BI_audit_KRS">
-                                <xref href="../{BI_audit_KRS/system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',1))}" > <!-\- href="../KRSY_{BI_audit_KRS/krs}/{BI_audit_KRS/krs}_1.dita" -\->
-                                    <xsl:value-of select="BI_audit_KRS/nazwa"/><xsl:text> </xsl:text>
-                                    <xsl:value-of select="BI_audit_KRS/S_miejscowosc"/><xsl:text> </xsl:text>
-                                </xref>
+                        <xsl:choose>
+                            <xsl:when test="position() = last()">
+                                <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body">
+                                    <!--<xsl:with-param name="system_cache__dita:xref__x3A__title">BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA</xsl:with-param>-->
+                                    <xsl:with-param name="end_fid" select="*/@fid"/>
+                                    <!--<xsl:with-param name="end_fid" select="parent::*//*[last()]/*[1]/@fid"/>-->
+                                    <xsl:with-param name="fid" select="parent::*//*[1]/*[1]/@fid"/>
+                                    <!--<xsl:with-param name="fid" select="*[1]/@fid"/>-->
+                                    <xsl:with-param name="get_wfs:name_from_fid"></xsl:with-param>
+                                </xsl:apply-templates>
                             </xsl:when>
                             <xsl:otherwise>
-                                <xsl:for-each select="*/*">
-                                    <xsl:if test="text() and not(name()='A_STATUS') and not(name()='A_ADM_COMPANY') and not(name()='A_CLASSIFIED')">
-                                        <b><xsl:value-of select="name()"/></b><xsl:text> </xsl:text>
-                                        <xsl:apply-templates mode="enter_to_ph_text" select="text()">
-                                            <xsl:with-param name="element" select="'entry'"/>
-                                        </xsl:apply-templates>
-                                        <xsl:text> </xsl:text>
-                                    </xsl:if>
-                                </xsl:for-each>
+                                <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body">
+                                    <!--<xsl:with-param name="system_cache__dita:xref__x3A__title">BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA</xsl:with-param>-->
+                                    <!--<xsl:with-param name="end_fid" select="parent::*//*[last()]/*[1]/@fid"/>-->
+                                    <!--<xsl:with-param name="end_fid" select="parent::*//*[last()]/*[1]/@fid"/>-->
+                                    <!--<xsl:with-param name="fid" select="parent::*//*[1]/*[1]/@fid"/>-->
+                                    <!--<xsl:with-param name="fid" select="*[1]/@fid"/>-->
+                                </xsl:apply-templates>
                             </xsl:otherwise>
-                        </xsl:choose>-->
+                        </xsl:choose>
+                        
+                     
+                        <xsl:comment>#188</xsl:comment>
+                        
                         <xsl:if test="position()=last()">
                             <xsl:choose>
                                 <xsl:when test="count(parent::*//*[last()]/*[1]/*) &gt; 5">
                                     <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__conkey">
                                         <xsl:with-param name="fid" select="parent::*//*[last()]/*[1]/@fid"/>
-                                        <xsl:with-param name="system_cache__dita:element__x3A__name">image</xsl:with-param>
-                                        <xsl:with-param name="title">APU4_umowy</xsl:with-param>
-                                        <xsl:with-param name="graph.name">APU4-DPW</xsl:with-param>
+                                        <xsl:with-param name="system_cache__dita:element__x3A__name" select="'image'"/>
+                                        <xsl:with-param name="title" select="'APU4_umowy'"/>
+                                        <!--<xsl:with-param name="graph.name" select="'APU4-DPW'"/>-->
+                                        <xsl:with-param name="graph.name" select="'APU4-DKW'"/>
+                                        <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
                                     </xsl:call-template>
                                 </xsl:when>
                                 <xsl:otherwise>

+ 255 - 42
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl

@@ -17,6 +17,7 @@
     version="2.0"><!-- system_cache__appinfo system_cache__dita ogr Benford default_db get_wfs p5 p5gnuplot -->
     
     
+    <xsl:param name="system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max" select="500"/>
    
     
     <xsl:output indent="yes"/>
@@ -44,6 +45,7 @@
         <xsl:variable name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset">
             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset">
                 <xsl:with-param name="system_cache__dita:interested_row" select="$interested_row"/>
+                <xsl:with-param name="system_cache__dita:interested_row.noattrrs__x3A__include" select="true()"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs"/><!-- $system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq.current -->
             </xsl:call-template>
         </xsl:variable>
@@ -63,7 +65,7 @@
         <xsl:call-template name="system_cache__dita:ANALIZA_UMOW_4UA.graph">
             <xsl:with-param name="fid" select="@fid"/>                                                                           
             <xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset"/>
-            <xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>
+            <!--<xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>-->
             <xsl:with-param name="title" select="$title"/>
         </xsl:call-template>
         <xsl:call-template name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals">
@@ -112,6 +114,7 @@
                 <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
                     <xsl:with-param name="fid" select="@fid"/>
                     <xsl:with-param name="title" select="$title"/>
+                    <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
                 </xsl:call-template>
                 <xsl:result-document href="{system_cache__dita:files.key.href.write.topic.title.context(current(),$title)}"> <!--XX  href="{$temp}/{$uuid}/{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',$position)}.dita -->
                     
@@ -137,6 +140,7 @@
                             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset">
                                 <xsl:with-param name="system_cache__dita:interested_row" select="$interested_row"/>
                                 <xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs"/><!-- $system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq.current -->
+                                <xsl:with-param name="system_cache__dita:interested_row.noattrrs__x3A__include" select="true()"/>
                             </xsl:call-template>
                         </xsl:variable>
                         
@@ -164,8 +168,15 @@
                         
                         <body>
                             <p>
+                                <foreign props="firt">
+                                    <!--<xsl:copy-of select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset"></xsl:copy-of>-->
+                                </foreign>
                                 <foreign>
-                                    <xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.parent.attrs"/>
+                                    @@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.parent.attrs = <xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.parent.attrs"/>
+                                    parent::/@fid = <xsl:value-of select="parent::*/@fid"/> count(curr_gr)=<xsl:value-of select="count(current-group())"/>
+                                    parent::*/*[position()=1]/@fid = <xsl:value-of select="parent::*/*[position()=1]/@fid"/>
+                                    @@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs <xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs"/>
+                                    @@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs - <xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs"/>
                                 </foreign>
                                 
                             
@@ -178,9 +189,14 @@
                                             </dlentry>
                                         
                                         <dlentry props="do_200">
+                                            <dt/>
                                             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
-                                                <xsl:with-param name="fid" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs"/>
+                                                <!--<xsl:with-param name="fid" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs"/>-->
+                                                <xsl:with-param name="fid" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs"/><!-- parent::*/*[position()=1]/@fid -->
+                                                <!--<xsl:with-param name="end_fid" select="@fid"/>-->
+                                                <xsl:with-param name="title">BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA</xsl:with-param>
                                                 <xsl:with-param name="link__x3A__title">kontekst od</xsl:with-param>
+                                                <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
                                                 <xsl:with-param name="system_cache__dita:element__x3A__surrounding">dd</xsl:with-param>
                                                 <xsl:with-param name="system_cache__dita:element__x3A__surrounding.title">dt</xsl:with-param>
                                             </xsl:call-template>
@@ -191,7 +207,7 @@
                                     
                                 
                                         
-                                
+                                <xsl:comment>#2299</xsl:comment>
                                 
                                  
                                 <xsl:choose>
@@ -232,18 +248,16 @@
                             
                             
                             
-                            
-                            
                                         <xsl:choose>
                                             <xsl:when test="string-length($system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs)&gt;0">
                                                 <xsl:comment>#181 bypassed by string-length($system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs) gt; 0</xsl:comment>
                                             </xsl:when>
                                             <xsl:otherwise>
-                                                <p>
+                                                <p props="analiza_255">
                                                 <xsl:call-template name="system_cache__dita:ANALIZA_UMOW_4UA.graph">
                                                     <xsl:with-param name="fid" select="@fid"/>                                                                           
                                                     <xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset"/>
-                                                    <xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>
+                                                    <!--<xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>-->
                                                     <xsl:with-param name="title" select="$title"/>
                                                 </xsl:call-template>
                                                 </p>
@@ -345,7 +359,7 @@
     <xsl:template name="system_cache__dita:ANALIZA_UMOW_4UA.graph" >
         <xsl:param name="fid" select="@fid"/>
         <xsl:param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset" required="yes"/>
-        <xsl:param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" required="yes"/>
+        <!--<xsl:param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" required="yes"/>-->
         <xsl:param name="title" required="yes"/>
         <xsl:param name="graph.name" select="'APU4-P'"/>
         <!--<strow>
@@ -361,40 +375,50 @@
                     <xsl:with-param name="title" select="$title"/>
                 </xsl:call-template>
                 <strow props="graph.headers">
-                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset//*" group-by="@fid">
-                        <stentry current-grouping-key="{@fid}" props="graph.xtic" audience="powiazania"><xsl:copy-of select="string-join(*[@default_db__x3A__BI_audit_BENFORD:NameField]/text(),' ')"></xsl:copy-of></stentry><!--<xsl:value-of select="position()"/>-->
-                        <stentry current-grouping-key="{@fid}" props="graph.xtic" audience="powiazania"><xsl:copy-of select="string-join(*[@default_db__x3A__BI_audit_BENFORD:NameField]/text(),' ')"></xsl:copy-of><xsl:value-of select="nazwa"/></stentry><!--<xsl:value-of select="position()"/>--> 
+                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset/*/*" group-by="@fid">
+                        <xsl:for-each-group select="current-group()" group-by="@fid"><!-- $default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset//* -->
+                            <stentry current-grouping-key="{@fid}" props="graph.xtic" audience="powiazania"><xsl:copy-of select="string-join(*[@default_db__x3A__BI_audit_BENFORD:NameField]/text(),' ')"></xsl:copy-of></stentry><!--<xsl:value-of select="position()"/>-->
+                            <!--<stentry current-grouping-key="{@fid}"  audience="powiazania"><xsl:copy-of select="string-join(*[@default_db__x3A__BI_audit_BENFORD:NameField]/text(),' ')"></xsl:copy-of><xsl:value-of select="nazwa"/></stentry>--><!--<xsl:value-of select="position()"/>--> 
+                        </xsl:for-each-group>
                     </xsl:for-each-group>
                 </strow>
                 <strow props="graph.data">
-                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset//*" group-by="@fid">
-                        <stentry current-grouping-key="{@fid}"><xsl:value-of select="count(current-group())"/></stentry>
-                        <stentry current-grouping-key="{@fid}"><xsl:value-of select="min(current-group()/number(@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset.precedings.count.parent.following))"/></stentry>
+                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset/*/*" group-by="@fid">
+                        <xsl:for-each-group select="current-group()" group-by="@fid">
+                            <stentry current-grouping-key="{@fid}"><xsl:value-of select="count(current-group())"/></stentry>
+                            <!--<stentry current-grouping-key="{@fid}"><xsl:value-of select="min(current-group()/number(@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset.precedings.count.parent.following))"/></stentry>-->
+                        </xsl:for-each-group>
                     </xsl:for-each-group>
-                    
                 </strow>
                 
                 <!--<xsl:call-template name="p5gnuplot:simpletable__x3A__graph.stats">
                     <xsl:with-param name="system_cache__dita:context.path.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset"/>
-                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="'default_db__x3A__BI_audit_BENFORD:NameField'"/>
-                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="'default_db__x3A__BI_audit_BENFORD:NameField'"/>
-                    <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="'fid'"/>
-                    <xsl:with-param name="audience">powiazania</xsl:with-param>
-                    <!-\-<xsl:with-param name="group.root">koszt.</xsl:with-param>-\->
-                    <xsl:with-param name="group.count">iloscB.</xsl:with-param>
-                    <xsl:with-param name="group.sum">kosztB.</xsl:with-param>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="'@fid'"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset.precedings.count.parent.all'"/>
+                    <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="'fid'"/>
+                    <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset.precedings.count.parent.all'"/>
+                    <xsl:with-param name="audience">ilość</xsl:with-param>
+                    <!-\-<xsl:with-param name="group.root" select="1"/>-\->
+                    <!-\-<xsl:with-param name="group.count" select="1"/>-\->
+                    <!-\-<xsl:with-param name="group.count__x3A__path__x3A__length" select="1"/>-\->
+                    <!-\-<xsl:with-param name="group.sum">kosztB.</xsl:with-param>-\->
+                    
                 </xsl:call-template>-->
                 
                 <strow props="graph.title">
-                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset//*" group-by="@fid">
+                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset/*/*" group-by="@fid">
+                    <xsl:for-each-group select="current-group()" group-by="@fid">
                         <stentry current-grouping-key="{@fid}" audience="powiazania">ilość powiązań</stentry>
-                        <stentry current-grouping-key="{@fid}" audience="powiazania">minimalna dł. ścieżki</stentry>
+                        <!--<stentry current-grouping-key="{@fid}" audience="powiazania">minimalna dł. ścieżki</stentry>-->
+                    </xsl:for-each-group>
                     </xsl:for-each-group>
                 </strow>
                 <strow props="graph.color.name">
-                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset//*" group-by="@fid">
+                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset/*/*" group-by="@fid">
+                    <xsl:for-each-group select="current-group()" group-by="@fid">
                         <stentry current-grouping-key="{@fid}">brown</stentry>
-                        <stentry current-grouping-key="{@fid}">orange</stentry>
+                        <!--<stentry current-grouping-key="{@fid}">orange</stentry>-->
+                    </xsl:for-each-group>
                     </xsl:for-each-group>
                 </strow>
                 <!--<strow props="graph.color.variable">
@@ -404,21 +428,27 @@
                     </xsl:for-each-group>
                 </strow>-->
                 <strow props="graph.yaxis">
-                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset//*" group-by="@fid">
-                        <stentry current-grouping-key="{@fid}"/>
-                        <stentry current-grouping-key="{@fid}">2</stentry>
+                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset/*/*" group-by="@fid">
+                        <xsl:for-each-group select="current-group()" group-by="@fid">
+                            <stentry current-grouping-key="{@fid}"/>
+                            <!--<stentry current-grouping-key="{@fid}">2</stentry>-->
+                        </xsl:for-each-group>
                     </xsl:for-each-group>
                 </strow>
                 <strow props="graph.fill.style">
-                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset//*" group-by="@fid">
+                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset/*/*" group-by="@fid">
+                    <xsl:for-each-group select="current-group()" group-by="@fid">
                         <stentry current-grouping-key="{@fid}"> lw 2 </stentry>
-                        <stentry current-grouping-key="{@fid}"/>
+                        <!--<stentry current-grouping-key="{@fid}"/>-->
+                    </xsl:for-each-group>
                     </xsl:for-each-group>
                 </strow>
                 <strow props="graph.newhistogram">
-                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset//*" group-by="@fid">
+                    <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset/*/*" group-by="@fid">
+                    <xsl:for-each-group select="current-group()" group-by="@fid">
                         <stentry audience="powiazania" current-grouping-key="{@fid}"> powiązania </stentry>
                     </xsl:for-each-group>
+                    </xsl:for-each-group>
                 </strow>
             </simpletable>
             </SIMPLETABLE_WTITLE>
@@ -451,6 +481,15 @@
                     <xsl:with-param name="path.prefix">../</xsl:with-param>
                 </xsl:apply-templates>
                 </p>
+                <!--<xsl:choose>
+                    <xsl:when test="count($simpletable/simpletable//stentry) &gt;$system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max">
+                            <p props="count_166">wielkość zbioru <xsl:value-of select="count($simpletable/simpletable//stentry)"/> - pominięto wyświetlanie tabeli</p>
+                        </xsl:when>
+                    <xsl:otherwise>
+                        
+                    </xsl:otherwise>
+                </xsl:choose>-->
+                
                 <xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
                     <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                 </xsl:call-template>
@@ -644,11 +683,21 @@
                     <xsl:with-param name="simpletable" select="$simpletable"/>
                     <xsl:with-param name="title"> (APU4-DT) umowy obiektu tabela </xsl:with-param>
                 </xsl:call-template>-->
-                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
-                    <xsl:with-param name="title" select="$title"/>
-                    <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
-                </xsl:apply-templates>
+                <xsl:choose>
+                    <xsl:when test="count($simpletable/simpletable//stentry) &gt; $system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max">
+                        <p props="count_444">wielkość zbioru <xsl:value-of select="count($simpletable/simpletable//stentry)"/> - pominięto wyświetlanie tabeli</p>
+                    </xsl:when>
+                    <xsl:otherwise>
+                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
+                        <xsl:with-param name="title" select="$title"/>
+                        <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
+                    </xsl:apply-templates>
+                    </xsl:otherwise>
+                </xsl:choose>
                 <xsl:comment>#651</xsl:comment>
+                            <xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
+                                <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
+                            </xsl:call-template>
                 <!--<p> (<xsl:value-of select="$graph.name"/>) umowy obiektu wykres </p>-->
                 <foreign>
                     <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
@@ -674,6 +723,7 @@
         <xsl:param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" required="yes"/>
         <xsl:param name="title" required="yes"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="'default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter'"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:ValueType">default_db__x3A__BI_audit_BENFORD:leadingNumber</xsl:param>
         <xsl:param name="graph.name" select="'APU4-DKW'"/>
         <!--<strow>
             <xsl:copy-of select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset"/>
@@ -710,12 +760,23 @@
                             <!--<xsl:for-each-group select="current-group()" group-by="@default_db__x3A__BI_audit_BENFORD:leadingNumber">-->
                                 <!--<xsl:sort select="number(@default_db__x3A__BI_audit_BENFORD:leadingNumber)" data-type="number" order="ascending"/>-->
                                 <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:value-of select="count(current-group())"/></stentry>
-                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:value-of select="sum(current-group()/*[$default_db__x3A__BI_audit_BENFORD:FieldType]/number())"/></stentry>
+                            <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/></stentry>
                             <!--</xsl:for-each-group>-->
                         </xsl:for-each-group>
                         
                     </strow>
                     
+                    <xsl:call-template name="p5gnuplot:simpletable__x3A__graph.stats">
+                        <xsl:with-param name="system_cache__dita:context.path.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                        <xsl:with-param name="audience">rozklad</xsl:with-param>
+                        <!--<xsl:with-param name="group.root">koszt.</xsl:with-param>-->
+                        <xsl:with-param name="group.count">iloscB.</xsl:with-param>
+                        <xsl:with-param name="group.sum">kosztB.</xsl:with-param>
+                    </xsl:call-template>
                     
                    
                     
@@ -820,6 +881,18 @@
                         <xsl:with-param name="path.prefix">../</xsl:with-param>
                     </xsl:apply-templates>
                 <!--</p>-->
+                <!-- ANALIZA WYKRESOW -->
+                    <!--<xsl:choose>
+                        <xsl:when test="count($simpletable/simpletable//stentry) &gt; $system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max">
+                            <p props="count_166">wielkość zbioru <xsl:value-of select="count($simpletable/simpletable//stentry)"/> - pominięto wyświetlanie tabeli</p>
+                        </xsl:when>
+                        <xsl:otherwise>
+                    
+                        </xsl:otherwise>
+                    </xsl:choose>-->
+                <xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
+                    <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
+                </xsl:call-template>
             </xsl:when>
             <xsl:otherwise>
                 <!--<p props="214a">
@@ -868,11 +941,11 @@
                             <xsl:sort select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]" order="ascending"/>
                             <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="count(current-group())"/></stentry>-->
                             <xsl:variable name="current-group.parent.count" select="count(current-group())"/>
-                            <stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/><xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/></stentry>
+                            <stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/></stentry>
                             <xsl:for-each-group select="current-group()" group-by="@default_db__x3A__BI_audit_BENFORD:leadingNumber">
                                 <xsl:sort select="number(@default_db__x3A__BI_audit_BENFORD:leadingNumber)" data-type="number" order="ascending"/>
                                 <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/><xsl:value-of select="count(current-group()) "/></stentry><!-- div $current-group.parent.count -->
-                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/><xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/></stentry>
+                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/></stentry>
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
@@ -881,6 +954,8 @@
                         <xsl:with-param name="system_cache__dita:context.path.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.related.childs.attrs.nodeset"/>
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
                         <xsl:with-param name="audience">rozklad</xsl:with-param>
                         <xsl:with-param name="group.root">koszt.</xsl:with-param>
                         <xsl:with-param name="group.count">iloscB.</xsl:with-param>
@@ -1016,6 +1091,15 @@
                 <xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
                     <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                 </xsl:call-template>
+                <!--<xsl:choose>
+                    <xsl:when test="count($simpletable/simpletable//stentry) &gt;$system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max">
+                        <p props="count_166">wielkość zbioru <xsl:value-of select="count($simpletable/simpletable//stentry)"/> - pominięto wyświetlanie tabeli</p>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        
+                    </xsl:otherwise>
+                </xsl:choose>-->
+                
                 
             </xsl:when>
             <xsl:otherwise>
@@ -1032,9 +1116,138 @@
         <xsl:param name="title"/>
         <title><parmname><xsl:value-of select="replace($title,'_',' ')"/></parmname>
             <!--<xsl:apply-templates mode="system_cache__dita:ANALIZA_UMOW_4UA.title" select="."/>-->
-            <xsl:apply-templates mode="system_cache__dita:ANALIZA_UMOW_4UA.title" />
+            <!--<xsl:apply-templates mode="system_cache__dita:ANALIZA_UMOW_4UA.title" />-->
+            
+            <xsl:choose>
+                <xsl:when test="Numer_kontrahenta/text()|ID/text()|source/text()|jednostka_organizacyjna/text()">
+                    <!--<sup>-->
+                    <ph>
+                        <xsl:if test="Numer_kontrahenta/text()"> nr kontr: <b><xsl:value-of select="Numer_kontrahenta"/></b></xsl:if>
+                        <xsl:if test="jednostka_organizacyjna/text()"> nr kontr: <b><xsl:value-of select="jednostka_organizacyjna"/></b></xsl:if>
+                        <xsl:if test="ID/text()"> ID <b><xsl:value-of select="ID"/></b></xsl:if>
+                        <xsl:if test="source/text()"> source <b><xsl:value-of select="source"/></b></xsl:if>
+                    </ph>
+                    <!--</sup>--> 
+                </xsl:when>
+            </xsl:choose>
+            <xsl:choose>
+            <xsl:when test="nazwa/text()|Pelna_nazwa_kontrahenta/text()">
+                <xsl:variable name="link__x3A__title">
+                    <xsl:if test="nazwa/text()"> nazwa: <b><xsl:value-of select="replace(nazwa,'SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ',' (Sp. z o.o.) ')"/></b></xsl:if>
+                    <xsl:if test="Pelna_nazwa_kontrahenta/text()"> nazwa : <b><xsl:value-of select="replace(Pelna_nazwa_kontrahenta,'SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ',' (Sp. z o.o.) ')"/></b></xsl:if>
+                </xsl:variable>
+                        <ph>
+                            <xsl:copy-of select="$link__x3A__title"></xsl:copy-of>
+                        </ph>
+            </xsl:when>
+            </xsl:choose>
+            
         </title>
-        <shortdesc>kontekst <xsl:value-of select="system_cache__dita:localname.translate(name())"/> [il.<xsl:value-of select="count(current-group())"/>] <parmname>ID</parmname> <cmdname><xsl:value-of select="get_wfs:id_from_fid(@fid)"/></cmdname> </shortdesc>
+        <shortdesc>
+            <ph>
+                <xsl:if test="count(following::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row) &gt;0"><uicontrol><varname>#nr</varname><markupname><xsl:value-of select="count(preceding::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row)+1"/></markupname></uicontrol></xsl:if>
+            </ph>
+            
+            kontekst <xsl:value-of select="system_cache__dita:localname.translate(name())"/> [il.<xsl:value-of select="count(current-group())"/>] <parmname>ID</parmname> <cmdname><xsl:value-of select="get_wfs:id_from_fid(@fid)"/></cmdname>
+            <xsl:if test="nazwisko/text()"> nazwisko: <b><xsl:value-of select="nazwisko"/></b></xsl:if>
+            <xsl:if test="imiona/text()"> imiona: <b><xsl:value-of select="imiona"/></b></xsl:if>
+            <xsl:choose>
+                <xsl:when test="pesel/text()|PESEL/text()">
+                    <!--<sup>-->
+                    <ph>
+                        <xsl:if test="pesel/text()"> PESEL: <b><xsl:value-of select="pesel"/></b></xsl:if>
+                        <xsl:if test="PESEL/text()"> PESEL: <b><xsl:value-of select="PESEL"/></b></xsl:if>
+                    </ph>
+                    <!--</sup>-->
+                </xsl:when>
+            </xsl:choose>
+            <xsl:choose>
+                <xsl:when test="krs/text()|regon/text()|KRS/text()|REGON/text()|NIP/text()|nip/text()">
+                    <!--<sup>-->
+                    <ph>
+                        <xsl:if test="krs/text()"> KRS: <b><xsl:value-of select="krs"/></b></xsl:if>
+                        <xsl:if test="KRS/text()"> KRS: <b><xsl:value-of select="KRS"/></b></xsl:if>
+                        <xsl:if test="regon/text()"> REGON: <b><xsl:value-of select="regon"/></b></xsl:if>
+                        <xsl:if test="REGON/text()"> REGON: <b><xsl:value-of select="REGON"/></b></xsl:if>
+                        <xsl:if test="NIP/text()"> NIP: <b><xsl:value-of select="NIP"/></b></xsl:if>
+                        <xsl:if test="nip/text()"> NIP: <b><xsl:value-of select="nip"/></b></xsl:if>
+                        
+                    </ph>
+                    <!--</sup>-->
+                </xsl:when>
+            </xsl:choose>
+            <xsl:choose>
+                <xsl:when test="S_kraj/text()|S_wojewodztwo/text()">
+                    <!--<sup>-->
+                    <ph>
+                        <xsl:if test="S_kraj/text()"> kraj: <b><xsl:value-of select="S_kraj"/></b></xsl:if>
+                        <xsl:if test="S_wojewodztwo/text()"> woj.: <b><xsl:value-of select="S_wojewodztwo"/></b></xsl:if>
+                        
+                    </ph>
+                    <!--</sup>-->
+                </xsl:when>
+            </xsl:choose>
+            <xsl:choose>
+                <xsl:when test="A_miejscowosc/text()|Miejscowosc/text()|A_ulica/text()|A_nrDomu/text()|ulica/text()|Numer_budynku/text()|nrLokalu/text()|Numer_mieszkania_lokalu/text()|Ulica/text()">
+                    <!--<sup>-->
+                    <ph>
+                        <xsl:if test="A_miejscowosc/text()"> msc.: <b><xsl:value-of select="A_miejscowosc"/></b></xsl:if>
+                        <xsl:if test="Miejscowosc/text()"> msc.: <b><xsl:value-of select="Miejscowosc"/></b></xsl:if>
+                        <xsl:if test="A_ulica/text()"> ul.: <b><xsl:value-of select="A_ulica"/></b></xsl:if>
+                        <xsl:if test="ulica/text()"> ul.: <b><xsl:value-of select="ulica"/></b></xsl:if>
+                        <xsl:if test="Ulica/text()"> ul.: <b><xsl:value-of select="Ulica"/></b></xsl:if>
+                        <xsl:if test="A_nrDomu/text()"> dom: <b><xsl:value-of select="A_nrDomu"/></b></xsl:if>
+                        <xsl:if test="Numer_budynku/text()"> dom: <b><xsl:value-of select="Numer_budynku"/></b></xsl:if>
+                        <xsl:if test="nrLokalu/text()"> lok.: <b><xsl:value-of select="nrLokalu"/></b></xsl:if>
+                        <xsl:if test="A_nrLokalu/text()"> lok.: <b><xsl:value-of select="A_nrLokalu"/></b></xsl:if>
+                        
+                        <xsl:if test="Numer_mieszkania_lokalu/text()"> lok.: <b><xsl:value-of select="Numer_mieszkania_lokalu"/></b></xsl:if>
+                    </ph>
+                    <!--</sup>-->
+                </xsl:when>
+            </xsl:choose>
+            <xsl:choose>
+                <xsl:when test="A_poczta/text()|kodPocztowy/text()|A_kod/text()">
+                    <!--<sup>-->
+                    <ph>
+                        <xsl:if test="A_poczta/text()"> poczta: <b><xsl:value-of select="A_poczta"/></b></xsl:if>
+                        <xsl:if test="kodPocztowy/text()"> kod: <b><xsl:value-of select="kodPocztowy"/></b></xsl:if>
+                        <xsl:if test="A_kod/text()"> kod: <b><xsl:value-of select="A_kod"/></b></xsl:if>
+                    </ph>
+                    <!--</sup>-->
+                </xsl:when>
+            </xsl:choose>
+            <xsl:choose>
+                <xsl:when test="BI_audit_ENERGA_PRACOWNICY_adresy/*">
+                    <xsl:for-each select="BI_audit_ENERGA_PRACOWNICY_adresy">
+                        <p>
+                            <!--<sup>-->
+                            <xsl:choose>
+                                <xsl:when test="last() &gt; 0"><i> adres nr <xsl:value-of select="position()"/>/<xsl:value-of select="last()"/></i></xsl:when>
+                            </xsl:choose>
+                            
+                            <xsl:if test="kodPocztowy/text()"> kod: <b><xsl:value-of select="kodPocztowy"/></b> </xsl:if>
+                            <xsl:if test="miejscowosc/text()"> msc.: <b><xsl:value-of select="miejscowosc"/></b> </xsl:if>
+                            <xsl:if test="ulica/text()"> ul.: <b><xsl:value-of select="ulica"/></b> </xsl:if>
+                            <xsl:if test="nrBudynku/text()"> dom: <b><xsl:value-of select="nrBudynku"/></b> </xsl:if>
+                            <xsl:if test="nrLokalu/text()"> lok.: <b><xsl:value-of select="nrLokalu"/></b> </xsl:if>
+                            <!--</sup>-->
+                        </p>
+                    </xsl:for-each>
+                </xsl:when>
+            </xsl:choose>
+            
+            <xsl:choose>
+                <xsl:when test="BI_audit_taxpayer  ">
+                    <ph>
+                        <ph>Status VAT: <b><xsl:value-of select="BI_audit_taxpayer/taxpayer_status_info"/></b></ph> 
+                        <ph>stan na dzień: <b><xsl:value-of select="BI_audit_taxpayer/taxpayer_status_date"/></b> </ph>
+                    </ph>
+                    
+                </xsl:when>
+            </xsl:choose>
+            
+        </shortdesc>
         <prolog>
             <metadata>
                 <xsl:call-template name="system_cache__dita:indexterm">

+ 116 - 0
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UKR.xsl

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns:ogr="http://ogr.maptools.org/"
+    xmlns:Benford="https://pl.wikipedia.org/wiki/Rozkład_Benforda"
+    xmlns:default_db="https://biuro.biall-net.pl/wfs/default_db"
+    xmlns:p5="https://biuro.biall-net.pl/wfs"
+    xmlns:get_wfs="http://biuro.biall-net.pl/WPS_Functions/get_wfs/get_wfs.xsd"
+    xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+    xmlns:default_db__x3A__BI_audit_ENERGA_RUM_UMOWY="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_UMOWY"
+    xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA="https://biuro.biall-net.pl/wfs/default_db/ENERGA_RUM_KONTRAHENCI_POWIAZANIA"
+    xmlns:default_db__x3A__BI_audit_VALIDATE="https://biuro.biall-net.pl/wfs/default_db/BI_audit_VALIDATE"
+    xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
+    exclude-result-prefixes="xs "
+    xmlns:Linear_regression="https://en.wikipedia.org/wiki/Linear_regression"
+    version="2.0"><!-- system_cache__appinfo system_cache__dita ogr Benford default_db get_wfs p5 p5gnuplot -->
+    
+    
+   
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    <xsl:template mode="system_cache__dita:ANALIZA_KORELACJI_UKR" match="*"/>
+    
+    <xsl:template mode="system_cache__dita:ANALIZA_KORELACJI_UKR" match="*[not(preceding::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row)]">
+        <xsl:param name="group_name" required="yes"/>
+        <xsl:param name="position" required="yes"/>
+        <xsl:param name="resulset" required="yes"/>
+        <xsl:param name="title">ANALIZA_UMOW_4UKR</xsl:param>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:valueField"   required="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:groupField"   required="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:timeField"   required="yes"/>
+        <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed" required="yes"/>
+        <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq" required="yes"/>
+        <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current" required="yes"/>
+        <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq.current" required="yes"/>
+        <xsl:param name="interested_row" required="yes"/>
+        <xsl:param name="source"/>
+        <xsl:param name="mode" required="yes" tunnel="yes"/>
+        <xsl:param name="system_cache__dita:print" select="'no'"/>
+        <xsl:comment>#40 Linear_regression="https://en.wikipedia.org/wiki/Linear_regression" $title = <xsl:value-of select="$title"/></xsl:comment>
+        
+        <topicref  platform="{$position}" audience="{$title}" props="name {local-name()} {$default_db__x3A__BI_audit_BENFORD:valueField} {$default_db__x3A__BI_audit_BENFORD:timeField}" print="{$system_cache__dita:print}" toc="no"><!-- group_name="{$group_name}" -->
+            <xsl:copy-of select="system_cache__dita:files.key.title.context.href(current(),'map',$title)" copy-namespaces="no"/>
+            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
+                <xsl:with-param name="fid" select="@fid"/>
+                <xsl:with-param name="title" select="$title"/>
+                <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
+            </xsl:call-template>
+            <xsl:result-document href="{system_cache__dita:files.key.href.write.topic.title.context(current(),$title)}"> <!--XX  href="{$temp}/{$uuid}/{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',$position)}.dita -->
+                
+                <!--                    Analiza spójności liczbowej dla ID kontr <xsl:value-of select="current()/ID"/>
+-->                    
+                
+                <topic  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                    xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+                    <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+                        <xsl:with-param name="fid" select="@fid"/>
+                        <xsl:with-param name="title" select="$title"/>
+                    </xsl:call-template>
+                    <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
+                        <xsl:with-param name="fid" select="@fid"/>
+                        <xsl:with-param name="title" select="$title"/>
+                    </xsl:call-template>
+                    
+                    <title>4UKR</title>
+                    
+                    <xsl:call-template name="system_cache__dita:ANALIZA_KORELACJI_UKR__x3A__compare"/>
+                    
+                    
+                </topic>
+            </xsl:result-document>
+        </topicref>
+        
+        
+    </xsl:template>
+    
+    
+    <xsl:template name="system_cache__dita:ANALIZA_KORELACJI_UKR__x3A__compare">
+        
+        <dl>
+            <dlhead>
+                <ddhd>
+                    Analiza
+                </ddhd>
+            </dlhead>
+            
+            <xsl:for-each select="preceding::*[@fid]">
+                <dt>
+                    <dlentry>
+                        <dt/>
+                        <dd>
+                            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
+                                <xsl:with-param name="fid" select="@fid"/>
+                                <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
+                                <xsl:with-param name="system_cache__dita:element__x3A__surrounding">dlentry</xsl:with-param>
+                            </xsl:call-template>
+                        </dd>
+                    </dlentry>
+                </dt>
+            </xsl:for-each>
+            
+            
+        </dl>
+        
+        
+    </xsl:template>
+    
+                
+    <xsl:template mode="system_cache__dita:ANALIZA_KORELACJI_UKR" match="text()|comment()"></xsl:template>
+                
+    
+</xsl:stylesheet>

+ 143 - 13
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_context.path.keyrefs.xsl

@@ -13,6 +13,7 @@
     xmlns:default_db__x3A__BI_audit_VALIDATE="https://biuro.biall-net.pl/wfs/default_db/BI_audit_VALIDATE"
     xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
     xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA="https://biuro.biall-net.pl/wfs/default_db/ENERGA_RUM_KONTRAHENCI_POWIAZANIA"
+    xmlns:Linear_regression="https://en.wikipedia.org/wiki/Linear_regression"
     exclude-result-prefixes="xs "
     version="2.0"><!-- system_cache__appinfo system_cache__dita ogr Benford default_db get_wfs p5 p5gnuplot -->
     
@@ -42,6 +43,7 @@
         <xsl:param name="p5gnuplot:value"/>
         <xsl:param name="props"/>
         <xsl:param name="end_fid"/>
+        <xsl:param name="Linear_regression:calculate_matrix__x3A__to_dita"/>
         <xsl:variable name="out">
             <xsl:if test="$system_cache__dita:element__x3A__name"><xsl:value-of select="concat(',',$system_cache__dita:element__x3A__name)"/></xsl:if>
             <xsl:if test="$get_wfs:name_from_fid"><xsl:value-of select="concat(',',$get_wfs:name_from_fid)"/></xsl:if>
@@ -52,16 +54,20 @@
             <xsl:if test="$foreign_fallback"><xsl:value-of select="concat(',',$foreign_fallback)"/></xsl:if>
             <xsl:if test="$p5gnuplot:value"><xsl:value-of select="concat(',',$p5gnuplot:value)"/></xsl:if>
             <xsl:if test="$props"><xsl:value-of select="concat(',',$props)"/></xsl:if>
+            <xsl:if test="$Linear_regression:calculate_matrix__x3A__to_dita"><xsl:value-of select="concat(',',$Linear_regression:calculate_matrix__x3A__to_dita)"/></xsl:if>
             <xsl:if test="$end_fid"><xsl:value-of select="concat(',','...',$end_fid)"/></xsl:if>
+            
         </xsl:variable>
-        <xsl:for-each select="tokenize($out,',')">
-            <xsl:choose>
-                <xsl:when test="current()=''"/>
-                <xsl:when test="position()=last()"><xsl:value-of select="."/><xsl:text></xsl:text></xsl:when>
-                <xsl:otherwise><xsl:value-of select="."/><xsl:text>_</xsl:text></xsl:otherwise>
-            </xsl:choose>
-        </xsl:for-each>
-        
+        <xsl:variable name="out">
+            <xsl:for-each select="tokenize($out,',')">
+                <xsl:choose>
+                    <xsl:when test="current()=''"/>
+                    <xsl:when test="position()=last()"><xsl:value-of select="."/><xsl:text></xsl:text></xsl:when>
+                    <xsl:otherwise><xsl:value-of select="."/><xsl:text>_</xsl:text></xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>
+        </xsl:variable>
+            <xsl:value-of select="replace($out,'_\.\.\.','...')"/>
     </xsl:template>
     
     
@@ -78,6 +84,8 @@
         <xsl:param name="p5gnuplot:value"/>
         <xsl:param name="props"/>
         <xsl:param name="end_fid"/>
+        <xsl:param name="Linear_regression:calculate_matrix__x3A__to_dita"/>
+        
             <xsl:attribute name="keys">
                 <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__generate__key">
                     <xsl:with-param name="title" select="$title"/>
@@ -90,9 +98,9 @@
                     <xsl:with-param name="p5gnuplot:value"  select="$p5gnuplot:value"/>
                     <xsl:with-param name="props" select="$props"/>
                     <xsl:with-param name="end_fid" select="$end_fid"/>
+                    <xsl:with-param name="Linear_regression:calculate_matrix__x3A__to_dita" select="$Linear_regression:calculate_matrix__x3A__to_dita"/>
                 </xsl:call-template>
             </xsl:attribute>
-        
     </xsl:template>
     
     <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__keydef">
@@ -135,6 +143,7 @@
         <xsl:param name="fileindex"/>
         <xsl:param name="p5gnuplot:value"/>
         <xsl:param name="props"/>
+        <xsl:param name="Linear_regression:calculate_matrix__x3A__to_dita"/>
         <xsl:attribute name="id" >
             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
                 <xsl:with-param name="system_cache__dita:element__x3A__name" select="$system_cache__dita:element__x3A__name"/>
@@ -144,11 +153,119 @@
                 <xsl:with-param name="fileindex" select="$fileindex"/>
                 <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
                 <xsl:with-param name="props" select="$props"/>
+                <xsl:with-param name="Linear_regression:calculate_matrix__x3A__to_dita" select="$Linear_regression:calculate_matrix__x3A__to_dita"/>
             </xsl:call-template>
         </xsl:attribute>
     </xsl:template>
     
     
+    <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__href">
+        <xsl:param name="system_cache__dita:element__x3A__name"/>
+        <xsl:param name="title"/>
+        <xsl:param name="graph.name"/>
+        <xsl:param name="fid"/>
+        <xsl:param name="fileindex"/>
+        <xsl:param name="p5gnuplot:value"/>
+        <xsl:param name="props"/>
+        <xsl:param name="system_cache__dita:root__x3A__name"/>
+            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__full__x3A__filepath">
+                <xsl:with-param name="system_cache__dita:root__x3A__name" select="$system_cache__dita:root__x3A__name"/>
+            </xsl:call-template>
+            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__generate__key">
+                <xsl:with-param name="system_cache__dita:element__x3A__name" select="$system_cache__dita:element__x3A__name"/>
+                <xsl:with-param name="title" select="$title"/>
+                <xsl:with-param name="graph.name" select="$graph.name"/>
+                <xsl:with-param name="fid" select="$fid"/>
+                <xsl:with-param name="fileindex" select="$fileindex"/>
+                <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
+                <xsl:with-param name="props" select="$props"/>
+            </xsl:call-template>
+        <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__full__x3A__filepath__x3A__suffix"/>
+    </xsl:template>
+    
+    <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__full__x3A__filepath">
+        <xsl:param name="temp" select="$temp"/>
+        <xsl:param name="uuid" select="$uuid"/>
+        <xsl:param name="system_cache__dita:root__x3A__name" select="'context.path.keyref__x3A__full__x3A__filepath'"/>
+        <xsl:value-of select="concat($temp,'/',$uuid,'/',$system_cache__dita:root__x3A__name,'/')"/>
+    </xsl:template>
+    
+    <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__full__x3A__filepath__x3A__suffix">
+        <xsl:text>.xml</xsl:text>
+    </xsl:template>
+    
+    <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__result-document">
+        <xsl:param name="context__x3A__to__x3A__save"/>
+        <xsl:param name="system_cache__dita:element__x3A__name"/>
+        <xsl:param name="title"/>
+        <xsl:param name="graph.name"/>
+        <xsl:param name="fid"/>
+        <xsl:param name="fileindex"/>
+        <xsl:param name="p5gnuplot:value"/>
+        <xsl:param name="props"/>
+        <xsl:param name="system_cache__dita:root__x3A__name"/>
+        <xsl:variable name="href">
+            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__full__x3A__filepath">
+                <xsl:with-param name="system_cache__dita:root__x3A__name" select="$system_cache__dita:root__x3A__name"/>
+            </xsl:call-template>
+            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__generate__key">
+                <xsl:with-param name="system_cache__dita:element__x3A__name" select="$system_cache__dita:element__x3A__name"/>
+                <xsl:with-param name="title" select="$title"/>
+                <xsl:with-param name="graph.name" select="$graph.name"/>
+                <xsl:with-param name="fid" select="$fid"/>
+                <xsl:with-param name="fileindex" select="$fileindex"/>
+                <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
+                <xsl:with-param name="props" select="$props"/>
+            </xsl:call-template>
+            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__full__x3A__filepath__x3A__suffix"/>
+                
+            
+        </xsl:variable>
+        
+        <xsl:choose>
+            <xsl:when test="$context__x3A__to__x3A__save/*">
+                <xsl:message>#208 saving to <xsl:value-of select="$href"/></xsl:message>
+                <xsl:result-document href="{$href}">
+                    <xsl:copy-of select="$context__x3A__to__x3A__save"/>
+                </xsl:result-document>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:message>#208-NOT  === EMPTY saving to <xsl:value-of select="$href"/></xsl:message>
+            </xsl:otherwise>
+        </xsl:choose>
+        
+        
+    </xsl:template>
+    
+    <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__load-document">
+        <xsl:param name="system_cache__dita:root__x3A__name"/>
+        <xsl:param name="system_cache__dita:element__x3A__name"/>
+        <xsl:param name="title"/>
+        <xsl:param name="graph.name"/>
+        <xsl:param name="fid"/>
+        <xsl:param name="fileindex"/>
+        <xsl:param name="p5gnuplot:value"/>
+        <xsl:param name="props"/>
+        <xsl:variable name="href">
+            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__href">
+                <xsl:with-param name="system_cache__dita:element__x3A__name" select="$system_cache__dita:element__x3A__name"/>
+                <xsl:with-param name="title" select="$title"/>
+                <xsl:with-param name="graph.name" select="$graph.name"/>
+                <xsl:with-param name="fid" select="$fid"/>
+                <xsl:with-param name="fileindex" select="$fileindex"/>
+                <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
+                <xsl:with-param name="props" select="$props"/>
+            </xsl:call-template>
+        </xsl:variable>
+        <xsl:choose>
+            <xsl:when test="doc-available($href)">
+                <xsl:copy-of select="doc($href)"></xsl:copy-of>
+            </xsl:when>
+            <xsl:otherwise><xsl:message>#233 doc-available($href) unaviable (<xsl:value-of select="$href"/>)</xsl:message></xsl:otherwise>
+        </xsl:choose>
+        
+    </xsl:template>
+    
     
     
     <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
@@ -162,7 +279,7 @@
         <xsl:param name="system_cache__dita:element__x3A__surrounding">ph</xsl:param>
         <xsl:param name="system_cache__dita:element__x3A__surrounding.title">ph</xsl:param>
         <xsl:param name="link__x3A__title"/>
-        
+        <xsl:param name="get_wfs:name_from_fid"/>
         
         
         <xsl:variable name="end_fid" select="tokenize($end_fid,' ')[1]"/>
@@ -171,11 +288,20 @@
             <xsl:when test="string-length($fid)&gt;0">
                 <xsl:for-each select="tokenize($fid,' ')[1]">
                     <xsl:variable name="fid" select="current()"/>
-                    <xsl:if test="$link__x3A__title"><xsl:element name="{$system_cache__dita:element__x3A__surrounding.title}"><xsl:value-of select="$link__x3A__title"/></xsl:element></xsl:if>
+                    <!--<xsl:if test="$link__x3A__title"><xsl:element name="{$system_cache__dita:element__x3A__surrounding.title}"><xsl:copy-of select="$link__x3A__title"/></xsl:element></xsl:if>-->
                     <xsl:element name="{$system_cache__dita:element__x3A__surrounding}">
                         <xsl:choose>
                             <xsl:when test="string-length($end_fid)&gt;0">
-                                <xsl:attribute name="keyref" select="concat($fid,'...',$end_fid)"/>
+                                <xsl:attribute name="keyref">
+                                    <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
+                                        <xsl:with-param name="fid" select="$fid"/>
+                                        <xsl:with-param name="title" select="$title"/>
+                                        <xsl:with-param name="end_fid" select="$end_fid"/>
+                                        <xsl:with-param name="get_wfs:name_from_fid" select="$get_wfs:name_from_fid"/>
+                                    </xsl:call-template>
+                                </xsl:attribute>
+                                <xsl:if test="$link__x3A__title"><xsl:copy-of select="$link__x3A__title"/></xsl:if>
+                                <!--<xsl:attribute name="keyref" select="concat($fid,'...',$end_fid)"/>-->
                             </xsl:when>
                             <xsl:otherwise>
                                 <xsl:choose>
@@ -184,8 +310,10 @@
                                             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
                                                 <xsl:with-param name="fid" select="$fid"/>
                                                 <xsl:with-param name="title" select="$title"/>
+                                                <xsl:with-param name="get_wfs:name_from_fid" select="$get_wfs:name_from_fid"/>
                                             </xsl:call-template>
                                         </xsl:attribute>
+                                        <xsl:if test="$link__x3A__title"><xsl:copy-of select="$link__x3A__title"/></xsl:if>
                                     </xsl:when>
                                     <xsl:otherwise>
                                         <xref>
@@ -193,8 +321,10 @@
                                                 <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
                                                     <xsl:with-param name="fid" select="$fid"/>
                                                     <xsl:with-param name="title" select="$title"/>
+                                                    <xsl:with-param name="get_wfs:name_from_fid" select="$get_wfs:name_from_fid"/>
                                                 </xsl:call-template>
                                             </xsl:attribute><!-- select="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key.title(system_cache__dita:files.key.DETECT.OTHER(current(),$end_name,$end_fid,$pos),$title)" -->
+                                            <xsl:if test="$link__x3A__title"><xsl:copy-of select="$link__x3A__title"/></xsl:if>
                                         </xref>
                                     </xsl:otherwise>
                                 </xsl:choose>
@@ -202,7 +332,7 @@
                             
                             </xsl:otherwise>
                         </xsl:choose>
-                        <xsl:if test="string-length($link__x3A__title)&gt;0"><xsl:value-of select="$link__x3A__title"/></xsl:if>
+                        <!--<xsl:if test="string-length($link__x3A__title)&gt;0"><xsl:value-of select="$link__x3A__title"/></xsl:if>-->
                     </xsl:element>
                 </xsl:for-each>
             </xsl:when>

+ 19 - 8
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_context.path.xsl

@@ -93,7 +93,7 @@
             <default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs="{$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs}">
                 <xsl:for-each select="tokenize(current(),' ')">
                     <xsl:apply-templates mode="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset" select="$system_cache__dita:interested_row//*[@fid = current()]">
-                        <xsl:with-param name="system_cache__dita:interested_row.noattrrs__x3A__include" select="$system_cache__dita:interested_row.noattrrs__x3A__include" tunnel="yes"/>
+                        <xsl:with-param name="system_cache__dita:interested_row.noattrrs__x3A__include" select="$system_cache__dita:interested_row.noattrrs__x3A__include" />
                     </xsl:apply-templates>
                 </xsl:for-each>
             </default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset>
@@ -116,7 +116,9 @@
                     <xsl:for-each-group select="$tags//tag" group-by="text()" >
                         <xsl:for-each select="$system_cache__dita:interested_row//*[@fid = current()]">
                             <xsl:if test="position() = 1">
-                                <xsl:apply-templates mode="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset" select="." />
+                                <xsl:apply-templates mode="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset" select="." >
+                                    
+                                </xsl:apply-templates>
                             </xsl:if>
                         </xsl:for-each>
                     </xsl:for-each-group>
@@ -135,21 +137,28 @@
     
     
     <xsl:template mode="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset" match="*[*]">
-        <xsl:param name="system_cache__dita:interested_row.noattrrs__x3A__include" tunnel="yes"/>
+        <xsl:param name="system_cache__dita:interested_row.noattrrs__x3A__include" /><!-- tunnel="yes" -->
+        <xsl:message>#139 debug should call nodes  <xsl:value-of select="name()"/>; <xsl:value-of select="@fid"/>; </xsl:message>
         <xsl:copy>
             <xsl:copy-of select="@*"/>
             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset.precedings.count"/>
-            <xsl:apply-templates mode="#current"/>
+                
+            
+            <xsl:apply-templates mode="#current">
+                <xsl:with-param name="system_cache__dita:interested_row.noattrrs__x3A__include" select="$system_cache__dita:interested_row.noattrrs__x3A__include"/>
+            </xsl:apply-templates>
         </xsl:copy>
     </xsl:template>
     
     <xsl:template mode="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset" match="*[not(*) and not(@*)]">
-        <xsl:param name="system_cache__dita:interested_row.noattrrs__x3A__include" tunnel="yes"/>
+        <xsl:param name="system_cache__dita:interested_row.noattrrs__x3A__include" />
         <xsl:choose>
             <xsl:when test="$system_cache__dita:interested_row.noattrrs__x3A__include">
                 <xsl:copy>
                     <xsl:copy-of select="@*"/>
-                    <xsl:apply-templates mode="#current"/>
+                    <xsl:apply-templates mode="#current">
+                        <xsl:with-param name="system_cache__dita:interested_row.noattrrs__x3A__include" select="$system_cache__dita:interested_row.noattrrs__x3A__include"/>
+                    </xsl:apply-templates>
                 </xsl:copy>
             </xsl:when>
         </xsl:choose>
@@ -158,10 +167,12 @@
     
     
     <xsl:template mode="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset" match="*[@* and not(*)]">
-        <xsl:param name="system_cache__dita:interested_row.noattrrs__x3A__include" tunnel="yes"/>
+        <xsl:param name="system_cache__dita:interested_row.noattrrs__x3A__include" />
         <xsl:copy>
             <xsl:copy-of select="@*"/>
-            <xsl:apply-templates mode="#current"/>
+            <xsl:apply-templates mode="#current">
+                <xsl:with-param name="system_cache__dita:interested_row.noattrrs__x3A__include" select="$system_cache__dita:interested_row.noattrrs__x3A__include"/>
+            </xsl:apply-templates>
         </xsl:copy>
     </xsl:template>
     

+ 4 - 3
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row.xsl

@@ -267,13 +267,13 @@
                                             <xsl:when test="position()=last()">pos_last</xsl:when>
                                             <xsl:otherwise>pos_else</xsl:otherwise>
                                         </xsl:choose>
-                                        <xsl:text> mode__POWIAZANIA_row_3624 </xsl:text>
+                                        <xsl:text> mode__POWIAZANIA_row_3624 limit </xsl:text> <xsl:value-of select="$limit"/>
                                     </xsl:attribute>
-                                    <xsl:choose>
+                                    <!--<xsl:choose>
                                         <xsl:when test="position() &gt; $limit">
                                             <xsl:attribute name="processing-role">resource-only</xsl:attribute> 
                                         </xsl:when>
-                                    </xsl:choose>
+                                    </xsl:choose>-->
                                     <!--<xsl:for-each select="current-group()">-->
                                         <!--<xsl:copy-of select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.dita_pair.key.attr($current-save-file-id,system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid,'','','1'),system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid,'','','1'))"/>--> <!-- concat($group_name,'.dita')XXf -->
                                     <!--</xsl:for-each>-->
@@ -320,6 +320,7 @@
                                             <shortdesc>
                                                 
                                                 <menucascade>
+                                                    <xsl:if test="count(following::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row) &gt;0"><uicontrol><varname>#nr</varname><markupname><xsl:value-of select="count(preceding::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row)+1"/></markupname></uicontrol></xsl:if>
                                                     <uicontrol><varname>do</varname></uicontrol>
                                                     <uicontrol>  <xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = last()]/*[ position() = 1]/concat(Pelna_nazwa_kontrahenta,nazwa,nazwisko,' - ',Miejscowosc,imiona,imie,' ',NIP,' ',regon,' ',Nr_dzialki,firma,' ',Nr_KW,' ',Seller_person,pesel,miejscowosc)"/><xsl:text> </xsl:text>
                                                         <xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = last()]/*[ position() = 1]/Seller_person"/><xsl:text> </xsl:text> 

+ 37 - 142
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA.xsl

@@ -67,10 +67,13 @@
             <xsl:copy-of select="system_cache__dita:files.href.context.title.keydef(system_cache__dita:files.key.title.context.href(current(),'map',$title),BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1],'BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA')" copy-namespaces="no"/>
             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__keydef">
                 <xsl:with-param name="fid" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid"/>
-                <xsl:with-param name="end_fid" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid"/>
+                <!--<xsl:with-param name="end_fid" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid"/>-->
                 <xsl:with-param name="title">BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA</xsl:with-param>
                 <xsl:with-param name="href" select="system_cache__dita:files.key.href.write.topic.title.context(.,$title)"/>
+                <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
             </xsl:call-template>
+            <xsl:comment>#554 <xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid"/></xsl:comment>
+            
             <xsl:result-document href="{system_cache__dita:files.key.href.write.topic.title.context(.,$title)}"> <!-- system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href.write(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'',$current-grouping-key,$position)) --><!-- {$temp}/{$uuid}/{$group_name}_LIST.dita -->
                 <topic id="{$uuid}topic_simpletable_cheat_row_{replace($group_name,'/','')}_{ generate-id()}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
@@ -124,63 +127,56 @@
                             </xsl:choose>
                             
                             
-                            
-                            
-                            <!--<xref> <!-\- ../{BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1]/system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'','',1) }.dita -\-><!-\- XX1 sure -\->
-                                        <xsl:copy-of select="system_cache__dita:files.context.title.keyref(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1],'topic',$title)"></xsl:copy-of>
-                                        <xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/*[1]/concat(imiona,' ', nazwisko, ' ',nazwa,' ', nip)"/><!-\- XX1 sure -\->
-                                    </xref>-->
-                            <!--<equation-block>
-                                <equation-inline>APT-L</equation-inline>
-                                <equation-number>lista tras</equation-number>
-                            </equation-block>-->
-                            
+                           
                             
                             <xsl:for-each-group select="current-group()" group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid"><!-- local-name --><!-- last() -->
                                 <xsl:if test="position()=1">
                                     
-                                    <equation-block>
-                                        <equation-inline><tt><xsl:element name="{$system_cache__dita:subscript}">APT-L</xsl:element></tt></equation-inline>
-                                        <equation-number><xsl:element name="{$system_cache__dita:subscript}">lista tras</xsl:element></equation-number>
-                                        <equation-number><tt><xsl:element name="{$system_cache__dita:subscript}">od</xsl:element></tt></equation-number>
-                                        <equation-inline>
+                                    <ph>
+                                        <ph><tt><xsl:element name="{$system_cache__dita:subscript}">APT-L</xsl:element></tt></ph>
+                                        <ph><xsl:element name="{$system_cache__dita:subscript}">lista tras</xsl:element></ph>
+                                        <ph><tt><xsl:element name="{$system_cache__dita:subscript}">od</xsl:element></tt></ph>
+                                        <ph>
                                                <xref>
                                                     <xsl:copy-of select="system_cache__dita:files.context.title.keyref(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1],$title)" copy-namespaces="no"/>
                                                    <xsl:element name="{$system_cache__dita:subscript}"><xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]/system_cache__dita:localname.translate(local-name())"/></xsl:element>
                                               </xref>
-                                        </equation-inline>
+                                        </ph>
                                         
-                                        <equation-inline>
+                                        <ph>
                                             <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]">
                                                 <xsl:with-param name="system_cache__dita:subscript" select="$system_cache__dita:subscript"/>
-                                                <xsl:with-param name="system_cache__dita:element__x3A__parent">equation-inline</xsl:with-param>
+                                                <xsl:with-param name="end_fid" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position()=last()]/*[1]/@fid"/>
+                                                <xsl:with-param name="fid" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]/@fid"/>
+                                                <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
+                                                <xsl:with-param name="system_cache__dita:element__x3A__parent">ph</xsl:with-param>
                                             </xsl:apply-templates>
-                                        </equation-inline>
-                                    </equation-block>
+                                        </ph>
+                                    </ph>
                                     
                                     
                                 </xsl:if>
-                                <equation-block>
-                                    <equation-inline>
+                                <ph>
+                                    <ph>
                                         <tt><xsl:element name="{$system_cache__dita:subscript}">do</xsl:element></tt> 
-                                    </equation-inline>
-                                    <equation-inline>
+                                    </ph>
+                                    <ph>
                                         <xref>
                                             <xsl:copy-of select="system_cache__dita:files.dita_pair.keyref(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]/@fid,BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]/@fid)" copy-namespaces="no"/>
                                             <xsl:element name="{$system_cache__dita:subscript}"><xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]/system_cache__dita:localname.translate(local-name())"/></xsl:element>
                                         </xref>
-                                    </equation-inline>
-                                    <equation-inline>
-                                        ilość <equation-inline><xsl:value-of select="count(current-group())"/></equation-inline>
-                                    </equation-inline>
+                                    </ph>
+                                    <ph>
+                                        ilość <ph><xsl:value-of select="count(current-group())"/></ph>
+                                    </ph>
                                     
-                                    <equation-inline>
+                                    <ph>
                                         <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]">
                                             <xsl:with-param name="system_cache__dita:subscript" select="$system_cache__dita:subscript"/>
-                                            <xsl:with-param name="system_cache__dita:element__x3A__parent">equation-inline</xsl:with-param>
+                                            <xsl:with-param name="system_cache__dita:element__x3A__parent">ph</xsl:with-param>
                                         </xsl:apply-templates>
-                                    </equation-inline>
-                                </equation-block>
+                                    </ph>
+                                </ph>
                                 
                                 
                                 
@@ -188,114 +184,7 @@
                             </xsl:for-each-group>
                             
                             
-                                <!--<dl>
-                                    <dlhead>
-                                        <dthd>APT-L</dthd>
-                                        <ddhd>lista tras</ddhd>
-                                    </dlhead>
-                                    
-                                    <xsl:for-each-group select="current-group()" group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid"><!-\- local-name -\-><!-\- last() -\->
-                                        <xsl:if test="position()=1">
-                                            
-                                            <dlentry>
-                                                <dt>
-                                                    <xref>
-                                                        <xsl:copy-of select="system_cache__dita:files.context.title.keyref(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1],$title)" copy-namespaces="no"/>
-                                                        link
-                                                    </xref>
-                                                    
-                                                    od
-                                                    <equation-inline><xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]/system_cache__dita:localname.translate(local-name())"/></equation-inline>
-                                                </dt>
-                                                <dd>
-                                                    
-                                                </dd>
-                                            </dlentry>
-                                            <dlentry>
-                                                <dt/>
-                                                
-                                                <dd>
-                                                    <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]">
-                                                        <xsl:with-param name="system_cache__dita:subscript" select="$system_cache__dita:subscript"/>
-                                                    </xsl:apply-templates>
-                                                </dd>
-                                            </dlentry> 
-                                            
-                                        </xsl:if>
-                                        
-                                        <dlentry>
-                                            <dt> <xref>
-                                                <xsl:copy-of select="system_cache__dita:files.dita_pair.keyref(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]/@fid,BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]/@fid)" copy-namespaces="no"/>
-                                                link
-                                            </xref>
-                                                ilość <equation-inline><xsl:value-of select="count(current-group())"/></equation-inline>
-                                                do
-                                                <equation-inline><xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]/system_cache__dita:localname.translate(local-name())"/></equation-inline>
-                                            </dt>
-                                            <dd>
-                                                
-                                            </dd>
-                                            <dd>
-                                                <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]">
-                                                    <xsl:with-param name="system_cache__dita:subscript" select="$system_cache__dita:subscript"/>
-                                                </xsl:apply-templates>
-                                            </dd>
-                                        </dlentry>
-                                        
-                                        
-                                        
-                                        
-                                    </xsl:for-each-group>
-                                    
-                                </dl>-->
-                            
-                            
-                            
-                            <!--<simpletable frame="all" relcolwidth="1* 1* 3* 5*" >
-                                <sthead>
-                                    <stentry><sup>rejestr</sup></stentry>
-                                    <stentry><sup>ilosc</sup></stentry>
-                                    <!-\-<stentry>od</stentry>-\->
-                                    <stentry><sup>od</sup></stentry>
-                                    <stentry><sup>do</sup></stentry>
-                                </sthead>
-                                <xsl:for-each-group select="current-group()" group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid"><!-\- local-name -\-><!-\- last() -\->
-                                    
-                                    <strow>
-                                        <stentry><sup><xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]/system_cache__dita:localname.translate(local-name())"/></sup></stentry>
-                                        <stentry><sup><xsl:value-of select="count(current-group())"/></sup></stentry>
-                                        <!-\-<stentry><xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid"/></stentry>-\->
-                                        
-                                        <stentry>
-                                            <xref>
-                                                <xsl:copy-of select="system_cache__dita:files.context.title.keyref(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1],$title)" copy-namespaces="no"/>
-                                                link
-                                            </xref>
-                                            <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]">
-                                                <xsl:with-param name="system_cache__dita:subscript" select="$system_cache__dita:subscript"/>
-                                            </xsl:apply-templates>
-                                        </stentry>
-                                        <stentry>
-                                            <!-\-<xsl:value-of select="system_cache__dita:localname.translate(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]/local-name())"/>-\->
-                                            <xref>
-                                                <xsl:copy-of select="system_cache__dita:files.dita_pair.keyref(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]/@fid,BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]/@fid)" copy-namespaces="no"/>
-                                                link
-                                            </xref>
-                                            <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]">
-                                                <xsl:with-param name="system_cache__dita:subscript" select="$system_cache__dita:subscript"/>
-                                            </xsl:apply-templates>
-                                        </stentry>
-                                    </strow>
-                                    
-                                </xsl:for-each-group>
-                            </simpletable>-->
-                            <!--<xsl:for-each-group select="current-group()" group-by="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/local-name()">
-                                        <xsl:call-template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA.ends.desc.table">
-                                            <xsl:with-param name="row_obj_first" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ 1]/*[1]"/>
-                                            <xsl:with-param name="row_obj_last" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ last()]/*[1]"/>
-                                            <xsl:with-param name="context" select="$context"/>
-                                        </xsl:call-template>
-                                    </xsl:for-each-group>-->
+                                
                         </p>
                     </body>
                 </topic>
@@ -328,6 +217,12 @@
         <topicref> <!-- system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.href.write(system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'',$current-grouping-key,$position)) --><!-- {$group_name}_LIST.dita -->
             <xsl:copy-of select="system_cache__dita:files.key.title.context.href(current(),'map',$title)" copy-namespaces="no"/>
             <xsl:copy-of select="system_cache__dita:files.context.title.keys($context/*[1],$title)" copy-namespaces="no"/>
+            
+            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
+                <xsl:with-param name="fid" select="*[1]/@fid"/>
+                <xsl:with-param name="end_fid" select="parent::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/*[last()]/*[1]/@fid"/>
+                <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
+            </xsl:call-template>
             <xsl:attribute name="toc" select="'no'"/>
             <xsl:attribute name="props">
                 <xsl:choose>

+ 1 - 1
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.stats_all.xsl

@@ -72,7 +72,7 @@
             <body>
                 
                 <xsl:variable name="simpletable"> 
-                    <simpletable frame="all" id="{$uuid}BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.{local-name()}.dita" props="  graph.style.histogram graph.ylabel.nazwa graph.lingstring.break.size.25"><!-- print__no -->
+                    <simpletable frame="all" id="{$uuid}BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.{local-name()}.dita" props="  graph.style.histogram graph.ylabel.nazwa graph.lingstring.break.size.25  font9"><!-- print__no -->
                         <strow props="graph.headers">
                             <xsl:for-each-group select="current-group()[nazwisko|nazwa|Pelna_nazwa_kontrahenta|ID][position() &lt;$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.stats_all.size__x3A__limit]" group-by="@fid">
                                 <stentry props="graph.xtic" current-grouping-key="{current-grouping-key()}">

+ 49 - 15
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.xsl

@@ -71,6 +71,8 @@
     <xsl:include href="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl"/>
     <xsl:include href="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_context.path.xsl"/>
     
+    <xsl:include href="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UKR.xsl"/>
+    
     <xsl:variable name="KRS_own">
         <KRS_own>
            <!-- <KRS>0000033455</KRS>
@@ -945,23 +947,23 @@
                     </xsl:call-template>
                     
                 </topichead>-->
-               
+                <xsl:variable name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.UMOWY">
+                    <xsl:call-template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed">
+                        <xsl:with-param name="sources" select="$sources"/>
+                        <xsl:with-param name="interested_row" select="$interested_row"/>
+                        <xsl:with-param name="system_cache__dita:groupset.mode.BI_audit_ENERGA_RUM_KONTRAHENCI_UMOWY.path" select="true()"/><!-- system_cache__dita:groupset.mode.BI_audit_ENERGA_RUM_KONTRAHENCI_UMOWY.path -->
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField"    select="$default_db__x3A__BI_audit_BENFORD:valueField"  />
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:groupField"     select="$default_db__x3A__BI_audit_BENFORD:groupField"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField"   select="$default_db__x3A__BI_audit_BENFORD:timeField" />
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:AddressField" select="$default_db__x3A__BI_audit_BENFORD:AddressField" />
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"  />
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  />
+                    </xsl:call-template>
+                </xsl:variable>
                 <topichead navtitle="Powiązania do wybranych podmiotów/kontrahentów (APU4)" >
                     
-                    <xsl:variable name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.UMOWY">
-                        <xsl:call-template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed">
-                            <xsl:with-param name="sources" select="$sources"/>
-                            <xsl:with-param name="interested_row" select="$interested_row"/>
-                            <xsl:with-param name="system_cache__dita:groupset.mode.BI_audit_ENERGA_RUM_KONTRAHENCI_UMOWY.path" select="true()"/><!-- system_cache__dita:groupset.mode.BI_audit_ENERGA_RUM_KONTRAHENCI_UMOWY.path -->
-                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField"    select="$default_db__x3A__BI_audit_BENFORD:valueField"  />
-                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:groupField"     select="$default_db__x3A__BI_audit_BENFORD:groupField"/>
-                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField"   select="$default_db__x3A__BI_audit_BENFORD:timeField" />
-                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField"/>
-                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:AddressField" select="$default_db__x3A__BI_audit_BENFORD:AddressField" />
-                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"  />
-                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  />
-                        </xsl:call-template>
-                    </xsl:variable>
+                    
                     
                     <xsl:attribute name="props">APU4</xsl:attribute>
                     <xsl:attribute name="toc">no</xsl:attribute>
@@ -990,6 +992,38 @@
                     
                 </topichead>
                 
+                
+                <!--<topichead navtitle="Prosta analiza korelacji (UKR)" >
+                    
+                    
+                    
+                    <xsl:attribute name="props">UKR</xsl:attribute>
+                    <xsl:attribute name="toc">yes</xsl:attribute>
+                    <!-\-<xsl:attribute name="processing-role">resource-only</xsl:attribute>-\->
+                    
+                    <xsl:call-template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal">
+                        <xsl:with-param name="navtitle">Prosta analiza korelacji (UKR) </xsl:with-param>
+                        <xsl:with-param name="keys">_element_gwiazdka__mode_BI_audit_ENERGA_RUM_UMOWY_UKR</xsl:with-param>
+                        <xsl:with-param name="mode">system_cache__dita:ANALIZA_KORELACJI_UKR</xsl:with-param>
+                        <!-\-<xsl:with-param name="processing-role">resource-only</xsl:with-param>-\->
+                        <xsl:with-param name="element">*</xsl:with-param>
+                        <xsl:with-param name="interested_row" select="$interested_row"/>
+                        <xsl:with-param name="sources" select="$sources"/>
+                        <xsl:with-param name="resulset" select="$resulset"/>
+                        <xsl:with-param name="title" select="'UKR_analiza'"/>
+                        <xsl:with-param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.UMOWY"/>
+                        <!-\-<xsl:with-param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq"/>-\->
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField" select="$default_db__x3A__BI_audit_BENFORD:valueField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:groupField" select="$default_db__x3A__BI_audit_BENFORD:groupField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:AddressField" select="$default_db__x3A__BI_audit_BENFORD:AddressField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField" tunnel="yes"  />
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField" tunnel="yes" />
+                    </xsl:call-template>
+                    
+                </topichead>-->
+                
                 <xsl:choose>
                     <xsl:when test="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_old">
                         <topichead navtitle="Powiązania dla wariantu porównawczego raportów (dostępne, nie użyte)"/>

+ 99 - 16
SE/schema/default_db_xml_cache.public/default_db/Linear_regression/Linear_regression.xsl

@@ -8,6 +8,7 @@
     xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA="https://biuro.biall-net.pl/wfs/default_db/ENERGA_RUM_KONTRAHENCI_POWIAZANIA"
     xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
     xmlns:Linear_regression="https://en.wikipedia.org/wiki/Linear_regression"
+    xmlns:math="http://exslt.org/math"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -35,12 +36,15 @@
         <xsl:param name="Linear_regression:Y_attribute__x3A__set"/>
         <xsl:param name="Linear_regression:Y_element__x3A__set"/>
         <xsl:param name="Linear_regression:dataset" required="yes"/>
+        <xsl:param name="p5gnuplot:value"/>
+        
         <Linear_regression:calculate_data>
             <xsl:attribute name="Linear_regression:X_attribute__x3A__set" select="$Linear_regression:X_attribute__x3A__set"/>
             <xsl:attribute name="Linear_regression:Y_attribute__x3A__set" select="$Linear_regression:Y_attribute__x3A__set"/>
             <xsl:attribute name="Linear_regression:X_element__x3A__set" select="$Linear_regression:X_element__x3A__set"/>
             <xsl:attribute name="Linear_regression:Y_element__x3A__set" select="$Linear_regression:Y_element__x3A__set"/>
             <xsl:attribute name="name" select="$Linear_regression:dataset[1]/name()"/>
+            <xsl:attribute name="p5gnuplot:value" select="$p5gnuplot:value"/>
             <xsl:variable name="Linear_regression:calculate_data.XY">
                 <Linear_regression:calculate_data.XY>
                     <xsl:apply-templates mode="Linear_regression:calculate_data.XY" select="$Linear_regression:dataset">
@@ -74,15 +78,63 @@
     
     
     
+    
+    
+    <xsl:function name="Linear_regression:calculate_matrix__x3A__to_dita">
+        <xsl:param name="Linear_regression:slope-m"/>
+        <xsl:param name="Linear_regression:y-int.b"/>
+        <xsl:param name="Linear_regression:r"/>
+        <!--<xsl:param name="Linear_regression:n"/>-->
+        <xsl:call-template name="Linear_regression:calculate_matrix__x3A__to_dita">
+            <xsl:with-param name="Linear_regression:slope-m" select="$Linear_regression:slope-m"/>
+            <xsl:with-param name="Linear_regression:y-int.b" select="$Linear_regression:y-int.b"/>
+            <xsl:with-param name="Linear_regression:r" select="$Linear_regression:r"/>
+            <!--<xsl:with-param name="Linear_regression:n" select="$Linear_regression:n"/>-->
+        </xsl:call-template>
+    </xsl:function>
+    
+    
+    <xsl:function name="Linear_regression:calculate_matrix__x3A__value">
+        <xsl:param name="value"/>
+        <xsl:choose>
+            <xsl:when test="1=1"><xsl:value-of select="$value"/></xsl:when>
+            <xsl:when test="number($value) &lt;100"><xsl:value-of select="number($value)"/></xsl:when>
+            <xsl:when test="number($value) &lt;10"><xsl:value-of select="number($value)"/></xsl:when>
+            <xsl:when test="$value='NaN'"><xsl:value-of select="$value"/></xsl:when>
+            <xsl:otherwise><xsl:value-of select="xs:integer(substring(string($value),1,3))"/></xsl:otherwise>
+            
+        </xsl:choose>
+    </xsl:function>
+    
+    
+    <xsl:template name="Linear_regression:calculate_matrix__x3A__to_dita">
+        <xsl:param name="Linear_regression:slope-m"/>
+        <xsl:param name="Linear_regression:y-int.b"/>
+        <xsl:param name="Linear_regression:r"/>
+        <xsl:param name="Linear_regression:n"/>
+        <xsl:variable name="out">
+            <xsl:text>RL.</xsl:text><xsl:value-of select="round($Linear_regression:slope-m)"/><xsl:text>-</xsl:text>
+            <xsl:value-of select="round($Linear_regression:y-int.b)"/><xsl:text>-</xsl:text>
+            <xsl:value-of select="round($Linear_regression:r)"/><xsl:text></xsl:text>
+        </xsl:variable>
+        <xsl:value-of select="$out"/>
+    </xsl:template>
+    
     <xsl:template mode="Linear_regression:calculate_data__x3A__to_dita" match="Linear_regression:calculate_data.XY">
         <xsl:param name="system_cache__dita:element__x3A__parent" select="'equation-inline'"/>
         <xsl:element name="{$system_cache__dita:element__x3A__parent}">
+            <xsl:variable name="Linear_regression:calculate_matrix__x3A__to_dita" select="Linear_regression:calculate_matrix__x3A__to_dita(Linear_regression:XY16/@Linear_regression:XY16.slope.m,Linear_regression:XY16/@Linear_regression:XY16.y-int.b,Linear_regression:XY16/@Linear_regression:XY16.r)"/>
+            <!--<xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+                <xsl:with-param name="graph.name">calculate_matrix__x3A__to_dita</xsl:with-param>
+                <xsl:with-param name="Linear_regression:calculate_matrix__x3A__to_dita" select="$Linear_regression:calculate_matrix__x3A__to_dita"/>
+            </xsl:call-template>-->
             <xsl:attribute name="props" select="'Linear_regression.calculate_data__x3A__to_dita'"/>
-            <ph>Obliczono Regresję liniową z następującymi wynikami </ph>
-            <ph>trend m : </ph> <tt><xsl:value-of select="Linear_regression:XY16/@Linear_regression:XY16.slope.m"/></tt>
-            <ph> y-int.b :  </ph><tt><xsl:value-of select="Linear_regression:XY16/@Linear_regression:XY16.y-int.b"/></tt>
-            <ph>przybliżony parametr r :  </ph><tt> <xsl:value-of select="Linear_regression:XY16/@Linear_regression:XY16.r-like"/></tt>
-            <ph>obliczenia wykonano dla <xsl:value-of select="Linear_regression:XY11/@Linear_regression:XY11.n"/> elementów </ph>
+            <ph>Obliczono <b>Regresję liniową</b>    z następującymi wynikami </ph>
+            <ph>trend <i>m</i> : </ph> <b props="Linear_regression.m"><xsl:value-of select="Linear_regression:XY16/@Linear_regression:XY16.slope.m"/></b><xsl:text>; </xsl:text>
+            <ph> <i>y-int.b</i> :  </ph><b props="Linear_regression.y-int.b"><xsl:value-of select="Linear_regression:XY16/@Linear_regression:XY16.y-int.b"/></b>; <xsl:text>; </xsl:text>
+            <ph>przybliżony parametr <i>r</i> :  </ph><b props="Linear_regression.r"> <xsl:value-of select="Linear_regression:XY16/@Linear_regression:XY16.r"/></b>;<xsl:text>; </xsl:text>
+            <ph>obliczenia wykonano dla <i>n</i> <b props="Linear_regression.n"><xsl:value-of select="Linear_regression:XY11/@Linear_regression:XY11.n"/></b> elementów;  </ph>
+            <!--<ph>bieżący marker wykrytego profilu <i>P</i> <b><xsl:value-of select="$Linear_regression:calculate_matrix__x3A__to_dita"/></b></ph>-->
         </xsl:element>
     </xsl:template>
     
@@ -91,10 +143,10 @@
     <xsl:template mode="Linear_regression:calculate_data.XY16.y-int" match="Linear_regression:XY16">
         <xsl:copy>
             <xsl:copy-of select="@*"/>
-            <xsl:attribute name="Linear_regression:XY16.y-int.b" select="( ../Linear_regression:XY11/@Linear_regression:XY11.Ey - @Linear_regression:XY16.slope.m  * ../Linear_regression:XY11/@Linear_regression:XY11.Ex )  div ../Linear_regression:XY11/@Linear_regression:XY11.n "/>
-            <xsl:attribute name="Linear_regression:XY16.r" select="( ../Linear_regression:XY11/@Linear_regression:XY11.n  *  ../Linear_regression:XY11/@Linear_regression:XY11.Exy  -   ../Linear_regression:XY11/@Linear_regression:XY11.Ex  *  ../Linear_regression:XY11/@Linear_regression:XY11.Ey )"/>
-            <xsl:attribute name="Linear_regression:XY16.r-sqrt" select="( (../Linear_regression:XY11/@Linear_regression:XY11.n * ../Linear_regression:XY11/@Linear_regression:XY11.Ex2 - ../Linear_regression:XY14/@Linear_regression:XY14.Ex2  )*( ../Linear_regression:XY11/@Linear_regression:XY11.n * ../Linear_regression:XY11/@Linear_regression:XY11.Ey2 -  ../Linear_regression:XY14/@Linear_regression:XY14.Ey2   )  ) "/>
-            <xsl:attribute name="Linear_regression:XY16.r-like" select="( ../Linear_regression:XY11/@Linear_regression:XY11.n  *  ../Linear_regression:XY11/@Linear_regression:XY11.Exy  -   ../Linear_regression:XY11/@Linear_regression:XY11.Ex  *  ../Linear_regression:XY11/@Linear_regression:XY11.Ey ) div ( ( (../Linear_regression:XY11/@Linear_regression:XY11.n * ../Linear_regression:XY11/@Linear_regression:XY11.Ex2 - ../Linear_regression:XY14/@Linear_regression:XY14.Ex2  )*( ../Linear_regression:XY11/@Linear_regression:XY11.n * ../Linear_regression:XY11/@Linear_regression:XY11.Ey2 -  ../Linear_regression:XY14/@Linear_regression:XY14.Ey2   )  )  )"/>
+            <xsl:attribute name="Linear_regression:XY16.y-int.b" select="( number(../Linear_regression:XY11/@Linear_regression:XY11.Ey) - number(@Linear_regression:XY16.slope.m)  * number(../Linear_regression:XY11/@Linear_regression:XY11.Ex ))  div number(../Linear_regression:XY11/@Linear_regression:XY11.n) "/>
+            <xsl:attribute name="Linear_regression:XY16.r" select="( number(../Linear_regression:XY11/@Linear_regression:XY11.n )  *  number(../Linear_regression:XY11/@Linear_regression:XY11.Exy ) -  number( ../Linear_regression:XY11/@Linear_regression:XY11.Ex )  *  number( ../Linear_regression:XY11/@Linear_regression:XY11.Ey ) )
+                div math:sqrt( ( ( number(../Linear_regression:XY11/@Linear_regression:XY11.n) * number(../Linear_regression:XY11/@Linear_regression:XY11.Ex2 )- number( ../Linear_regression:XY14/@Linear_regression:XY14.Ex2 ) )*( number( ../Linear_regression:XY11/@Linear_regression:XY11.n ) * number( ../Linear_regression:XY11/@Linear_regression:XY11.Ey2 ) - number( ../Linear_regression:XY14/@Linear_regression:XY14.Ey2 )  )  )  )
+                "/>
         </xsl:copy>
     </xsl:template>
     
@@ -158,18 +210,31 @@
             <xsl:attribute name="position" select="count(preceding::*)"/>
             <xsl:attribute name="name" select="name()"/>
             <xsl:attribute name="count" select="count(descendant::*)"/>
+            <xsl:attribute name="text" select="text()"/>
+            <xsl:attribute name="curr_name" select="$Linear_regression:X_element__x3A__set"/>
+            <xsl:attribute name="if_local_x_ok" select=".[name()=$Linear_regression:X_element__x3A__set]/text()"/>
+            <xsl:attribute name="attrs"><xsl:value-of select="@*/name()"/></xsl:attribute>
             <xsl:choose>
                 <xsl:when test="string-length($Linear_regression:X_element__x3A__set)&gt;0">
                     <xsl:choose>
-                        <xsl:when test="*/local-name()=$Linear_regression:X_element__x3A__set">
-                            <Linear_regression:X><xsl:value-of select="*[local-name()=$Linear_regression:X_element__x3A__set]/text()"/></Linear_regression:X>
+                        <xsl:when test="*/local-name()=$Linear_regression:X_element__x3A__set and count(*/local-name()=$Linear_regression:X_element__x3A__set)=1" >
+                            <Linear_regression:X><xsl:value-of select="*[local-name()=$Linear_regression:X_element__x3A__set]/Linear_regression:convert__x3A__to__axis__digit($Linear_regression:X_element__x3A__set,text())"/></Linear_regression:X>
                         </xsl:when>
                         <xsl:when test="local-name()=$Linear_regression:X_element__x3A__set">
-                            <Linear_regression:X><xsl:value-of select="text()"/></Linear_regression:X>
+                            <Linear_regression:X><xsl:value-of select="Linear_regression:convert__x3A__to__axis__digit($Linear_regression:X_element__x3A__set,text())"/></Linear_regression:X>
                         </xsl:when>
                         <xsl:when test="name()=$Linear_regression:X_element__x3A__set">
-                            <Linear_regression:X><xsl:value-of select="text()"/></Linear_regression:X>
+                            <Linear_regression:X ><xsl:value-of select="Linear_regression:convert__x3A__to__axis__digit($Linear_regression:X_element__x3A__set,text())"/></Linear_regression:X>
                         </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:message terminate="no">#266 cannot found X <xsl:value-of select="$Linear_regression:X_element__x3A__set"/>; $Linear_regression:X_attribute__x3A__set=<xsl:value-of select="$Linear_regression:X_attribute__x3A__set"/>
+                                current attr = <xsl:for-each select="@*"> <xsl:value-of select="name()"/>; <xsl:value-of select="."/> ; </xsl:for-each> EOF
+                                <xsl:for-each select="*"> <xsl:value-of select="name()"/> = <xsl:value-of select="."/>  EOF </xsl:for-each>
+                                curr name = <xsl:value-of select="name()"/>;.
+                                
+                            
+                            </xsl:message>
+                        </xsl:otherwise>
                     </xsl:choose>
                 </xsl:when>
                 <xsl:otherwise>
@@ -205,6 +270,24 @@
         
     </xsl:template>
     
+    
+    <xsl:function name="Linear_regression:convert__x3A__to__axis__digit">
+        <xsl:param name="Linear_regression:name__x3A__set"/>
+        <xsl:param name="text"/>
+        <xsl:choose>
+            <xsl:when test="number($text)"><xsl:value-of select="number(Linear_regression:calculate_matrix__x3A__value($text))"/></xsl:when>
+            <xsl:when test="$Linear_regression:name__x3A__set='default_db__x3A__BI_audit_BENFORD:FieldType'">
+                <xsl:value-of select="$text"/>
+            </xsl:when>
+            <xsl:when test="$Linear_regression:name__x3A__set='default_db__x3A__BI_audit_BENFORD:leadingTime'"><xsl:value-of select="number(Linear_regression:calculate_matrix__x3A__value(replace(replace($text,'-',''),'\|','')))"/></xsl:when>
+            <xsl:when test="$Linear_regression:name__x3A__set='default_db__x3A__BI_audit_BENFORD:leadingTimeYear'"><xsl:value-of select="number(Linear_regression:calculate_matrix__x3A__value(replace(replace($text,'-',''),'\|','')))"/></xsl:when>
+            <xsl:when test="$Linear_regression:name__x3A__set='default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month'"><xsl:value-of select="number(Linear_regression:calculate_matrix__x3A__value(replace(replace($text,'-',''),'\|','')))"/></xsl:when>
+            <xsl:when test="$Linear_regression:name__x3A__set='default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter'"><xsl:value-of select="number(Linear_regression:calculate_matrix__x3A__value(replace(replace($text,'-',''),'\|','')))"/></xsl:when>
+            <xsl:when test="matches($text,'[0-9].[0-9]')"><xsl:value-of select="number(replace(replace(system_cache__dita:year-month($text),'-',''),'\|',''))"/></xsl:when>
+            <xsl:otherwise><xsl:value-of select="number(replace(replace($text,'-',''),'\|',''))"/></xsl:otherwise>
+        </xsl:choose>
+    </xsl:function>
+    
     <xsl:template mode="Linear_regression:calculate_data.XY" match="@*">
         <xsl:param name="Linear_regression:Y_attribute__x3A__set" required="yes"/>
         <xsl:param name="Linear_regression:X_attribute__x3A__set" required="yes"/>
@@ -215,17 +298,17 @@
                 <Linear_regression:X>
                     <xsl:choose>
                         <xsl:when test="$Linear_regression:X_attribute__x3A__set='default_db__x3A__BI_audit_BENFORD:FieldType'">
-                            <xsl:value-of select="../number(text())"/>
+                            <xsl:value-of select="../Linear_regression:convert__x3A__to__axis__digit($Linear_regression:X_attribute__x3A__set,current())"/>
                         </xsl:when>
                         <xsl:otherwise>
-                            <xsl:value-of select="number(replace(replace(current(),'-',''),'\|',''))"/>
+                            <xsl:value-of select="Linear_regression:convert__x3A__to__axis__digit($Linear_regression:X_attribute__x3A__set,current())"/>
                         </xsl:otherwise>
                     </xsl:choose>
                 </Linear_regression:X>
             </xsl:when>
             <xsl:when test="name()=$Linear_regression:Y_attribute__x3A__set">
                 <Linear_regression:Y>
-                    <xsl:value-of select="number(replace(replace(current(),'-',''),'\|',''))"/>
+                    <xsl:value-of select="Linear_regression:convert__x3A__to__axis__digit($Linear_regression:Y_attribute__x3A__set,current())"/>
                 </Linear_regression:Y>
             </xsl:when>
         </xsl:choose>

+ 3 - 0
SE/schema/default_db_xml_cache.public/default_db/big_values_format.xsl

@@ -22,4 +22,7 @@
         </xsl:variable>
         <xsl:value-of select="$out"/>
     </xsl:function>
+    
+    
+    
 </xsl:stylesheet>

+ 3 - 1
SE/schema/default_db_xml_cache.public/default_db/dateTime.xsl

@@ -41,6 +41,7 @@
     
     <xsl:function name="system_cache__dita:year-month">
         <xsl:param name="date"/>
+        <xsl:variable name="out">
         <xsl:choose>
             
             <xsl:when test="string($date) castable as xs:dateTime">
@@ -62,7 +63,8 @@
             </xsl:otherwise>
             
         </xsl:choose>
-        
+        </xsl:variable>
+        <xsl:value-of select="$out"/>
         
     </xsl:function>
     

+ 80 - 37
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl

@@ -15,11 +15,43 @@
     
     <xsl:template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
         <xsl:param name="fileindex" required="yes"/>
+        <!--<xsl:variable name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__load-document">
+            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__load-document">
+                <xsl:with-param name="system_cache__dita:root__x3A__name">simpletable__x3A__from_rows.xsl.dita__x3A__analyze</xsl:with-param>
+                <xsl:with-param name="fileindex" select="$fileindex"/>
+            </xsl:call-template>
+        </xsl:variable>-->
         <xsl:choose>
+            <!--<xsl:when test="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__load-document/*">
+                <xsl:message>#26 file loaded $fileindex=<xsl:value-of select="$fileindex"/></xsl:message>
+                <xsl:copy-of select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__load-document/p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze"/>
+            </xsl:when>-->
             <xsl:when test="p5gnuplot:graph.gnuplot.dita__x3A__if__x3A__aviable($fileindex) and p5gnuplot:graph.debug.xtics.xml__x3A__if__x3A__aviable($fileindex)">
-                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze" select="doc(p5gnuplot:set.gnuplot.debug.xtics.xml($fileindex))">
-                    <xsl:with-param name="fileindex" select="$fileindex" tunnel="yes"/>
-                </xsl:apply-templates>
+                <!--<xsl:message>#26-B NOT file loaded $fileindex=<xsl:value-of select="$fileindex"/>; analyzing</xsl:message>-->
+                <!--<xsl:variable name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__result-document">-->
+                    <!--<p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze>-->
+                <xsl:choose>
+                    <xsl:when test="doc-available(p5gnuplot:set.gnuplot.debug.xtics.xml($fileindex))">
+                        <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze" select="doc(p5gnuplot:set.gnuplot.debug.xtics.xml($fileindex))">
+                            <xsl:with-param name="fileindex" select="$fileindex" tunnel="yes"/>
+                        </xsl:apply-templates>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <foreign props="error_113_unaviable_file">doc-available(p5gnuplot:set.gnuplot.debug.xtics.xml($fileindex))</foreign>
+                            
+                        
+                    </xsl:otherwise>
+                </xsl:choose>
+                
+                    
+                    <!--</p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze>-->
+                <!--</xsl:variable>-->
+                <!--<xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__result-document">
+                    <xsl:with-param name="fileindex" select="$fileindex"/>
+                    <xsl:with-param name="system_cache__dita:root__x3A__name">simpletable__x3A__from_rows.xsl.dita__x3A__analyze</xsl:with-param>
+                    <xsl:with-param name="context__x3A__to__x3A__save" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__result-document"/>
+                </xsl:call-template>-->
+                <!--<xsl:copy-of select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__result-document"/>-->
             </xsl:when>
         </xsl:choose>
     </xsl:template>
@@ -60,11 +92,24 @@
                     <equation-inline>
                         Osie Y (wszystkie)
                     </equation-inline>
-                    <equation-inline>
-                        <xsl:call-template name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" />
-                            
-                        
-                    </equation-inline>
+                    
+                        <xsl:variable name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y">
+                            <equation-inline>
+                                <xsl:call-template name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" />
+                            </equation-inline>
+                        </xsl:variable>
+                    <xsl:for-each-group select="$system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y//equation-inline[@props='yaxis']" group-by="descendant::*[@props='p5gnuplot__dat.sthead.ytics.row.xml__x3A__detect_Y']/text()">
+                        <xsl:copy>
+                            <xsl:copy-of select="@*"/>
+                            <equation-inline><b><xsl:value-of select="current-grouping-key()"/></b></equation-inline>
+                            <equation-inline>ilość: </equation-inline>
+                            <equation-inline> <b><xsl:value-of select="count(current-group())"/></b></equation-inline>
+                            <equation-inline><xsl:for-each select="current-group()//*[@props='position']"><b><xsl:value-of select="text()"/></b><xsl:if test="not(position()=last())"><xsl:text>, </xsl:text></xsl:if></xsl:for-each></equation-inline>
+                            <xsl:comment>#017 iso</xsl:comment>
+                            <!--<foreign props="debug"><xsl:copy-of select="current-group()"></xsl:copy-of></foreign>-->
+                        </xsl:copy>
+                    </xsl:for-each-group>
+                    <xsl:comment>#109 eof osie</xsl:comment>
                 </dd>
                 <dd props="detect_X.all">
                     <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
@@ -76,9 +121,12 @@
                         Osie X
                     </equation-inline>
                     <equation-inline>
+                        
+                        
                         <xsl:call-template name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X" >
                             <xsl:with-param name="fileindex" select="$fileindex"/>
                         </xsl:call-template>
+                        
                     </equation-inline>
                 </dd>
                 
@@ -201,23 +249,25 @@
                     
                    
                 
-                <dlentry>
+                <!--<dlentry>
                     <dt>
                         Powiązania do innych elementów o podobnych cechach
                     </dt>
                     <dd>
-                        <equation-inline>
+                        <!-\-<equation-inline>
                             Wnioski
-                        </equation-inline>
+                        </equation-inline>-\->
                     </dd>
-                </dlentry>
+                </dlentry>-->
             </xsl:for-each>
             <dlentry>
                 <dt>
                     Podsumowanie całościowe
                 </dt>
                 <dd>
-                    <equation-inline>
+                </dd>
+            </dlentry>
+                    <!--<equation-inline>-->
                         <xsl:call-template name="p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze">
                             <!--<xsl:with-param name="p5gnuplot:value" select="@p5gnuplot:value"/>-->
                             <xsl:with-param name="fileindex" select="$fileindex"/>
@@ -226,17 +276,8 @@
                             <!--<xsl:with-param name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y"/>-->
                         </xsl:call-template>
                         
-                    </equation-inline>
-                </dd>
-                
-                <dd>
-                    
-                </dd>
-                <dd>
-                    
-                    
-                </dd>
-            </dlentry>
+                    <!--</equation-inline>-->
+          
         
         </dl>
     </xsl:template>
@@ -258,14 +299,15 @@
     
     
     <xsl:template mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" match="p5gnuplot:dat.sthead">
-        
+        <equation-inline props="yaxis">
         <ph props="p5gnuplot__file.row.y_detect_Y_133"><xsl:if test="count(preceding-sibling::p5gnuplot:dat.sthead) &gt;0">, </xsl:if> <equation-inline props="position"><xsl:value-of select="count(preceding-sibling::p5gnuplot:dat.sthead)+1"/></equation-inline>)</ph>
-        <q props="p5gnuplot__dat.sthead.ytics.row.xml__x3A__detect_Y">
+        <ph props="p5gnuplot__dat.sthead.ytics.row.xml__x3A__detect_Y">
             <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.yaxis.platform"/>
-        </q>
-        <markupname>
+        </ph>
+            <equation-inline>
             <xsl:value-of select="@p5gnuplot:value"/>
-        </markupname>
+        </equation-inline>
+        </equation-inline>
     </xsl:template>
     
     
@@ -288,17 +330,18 @@
     </xsl:template>
     
     <xsl:template mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X" match="p5gnuplot:dat.sthead.ytics.row">
-        
+        <equation-inline props="xaxis">
         <ph props="p5gnuplot__dat.sthead.ytics.row_163_cnt"><xsl:if test="count(preceding::p5gnuplot:dat.sthead.ytics.row) &gt;0">, </xsl:if><equation-inline props="position"><xsl:value-of select="count(preceding::p5gnuplot:dat.sthead.ytics.row)+1"/></equation-inline>) </ph>
-        <q props="p5gnuplot__dat.sthead.ytics.row_163">
-            <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.xaxis.platform"/>
-        </q>
+        <ph props="p5gnuplot__dat.sthead.ytics.row_163">
+            <b><xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.xaxis.platform"/></b>
+        </ph>
         <ph props="p5gnuplot__dat.sthead.ytics.row_199_props">
             <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.xaxis.props"/>
         </ph>
-        <markupname>
+            <equation-inline>
             <xsl:value-of select="@p5gnuplot:value"/>
-        </markupname>
+        </equation-inline>
+        </equation-inline>
     </xsl:template>
     
     <xsl:template mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" match="text()|comment()"/>
@@ -361,9 +404,9 @@
         
     
     <xsl:template match="system_cache__dita:graph.yaxis.platform" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y">
-        <q props="p5gnuplot.current-grouping-key.xtics">
+        <ph props="p5gnuplot.current-grouping-key.xtics">
             <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.yaxis.platform"/>
-        </q>
+        </ph>
         <!--<tt><xsl:value-of select="."/></tt>-->
     </xsl:template>
     

+ 62 - 64
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats.xsl

@@ -24,23 +24,28 @@
         <xsl:param name="system_cache__dita:context.path.attrs.nodeset" required="yes"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:FieldType" required="no"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:ValueType" required="yes"/><!-- which field value to use  attr -->
-        <xsl:param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:FieldType" /><!-- which field value to use  attr -->
+        <xsl:param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$default_db__x3A__BI_audit_BENFORD:FieldType" /><!-- which field value to use  attr -->
+        <xsl:param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:ValueType" />
         <xsl:param name="group.root"/>
         <xsl:param name="group.count"/>
+        <xsl:param name="group.count__x3A__path__x3A__length"/>
         <xsl:param name="group.sum"/>
         <xsl:param name="audience"/>
         <strow props="graph.stats">
             
-            <xsl:choose>
-                <xsl:when test="string-length($group.root) &gt;0">
+            
+            <xsl:comment>#38 $p5gnuplot:simpletable__x3A__graph.stats.group_by.root = <xsl:value-of select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/> ; $default_db__x3A__BI_audit_BENFORD:FieldType = <xsl:value-of select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>; </xsl:comment>
+            <xsl:comment>#39 p5gnuplot:simpletable__x3A__graph.stats.group_by = <xsl:value-of select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/> ; $$default_db__x3A__BI_audit_BENFORD:ValueType = <xsl:value-of select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>; </xsl:comment>
+            
                     <xsl:variable name="current-group.parent.count" select="count(current-group())"/>
-                    <xsl:for-each-group select="$system_cache__dita:context.path.attrs.nodeset/*/*" group-by="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]">
-                        <xsl:sort select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]" order="ascending"/>
+            <xsl:for-each-group select="$system_cache__dita:context.path.attrs.nodeset/*/*" group-by="@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]">
+                <xsl:sort select="@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]" order="ascending"/>
                         <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="count(current-group())"/></stentry>-->
                         <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/></stentry>-->
                         
-                        
-                        <stentry props="group.root" audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>
+                <xsl:if test="$group.root">      
+                    <stentry props="group.root" rev=" p5gnuplot:simpletable__x3A__graph.stats.group_by.root= {$p5gnuplot:simpletable__x3A__graph.stats.group_by.root}" audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]}" current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]}" ><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>
+                    
                             <xsl:call-template name="p5gnuplot:set.graph.group">
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
                                 <xsl:with-param name="group__x3A__value" select="$group.root"/>
@@ -51,66 +56,59 @@
                                 </xsl:apply-templates>
                             </xsl:for-each>
                             <!--<xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/>--></stentry>
+                </xsl:if>
+                        <xsl:for-each-group  select="current-group()" group-by="@*[name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by]"><!-- todo other -->
+                                    <xsl:sort select="number(@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ])" data-type="number" order="ascending"/>
+                                    
+                                    <xsl:if test="$group.sum">
+                                        <stentry rev=" group-by {$p5gnuplot:simpletable__x3A__graph.stats.group_by}"   props="group.sum"  current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"  audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
+                                            <xsl:call-template name="p5gnuplot:set.graph.group">
+                                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                                <xsl:with-param name="group__x3A__value" select="$group.sum"/>
+                                            </xsl:call-template>
+                                            
+                                            <xsl:for-each select="current-group()">
+                                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                                    
+                                                </xsl:apply-templates>
+                                            </xsl:for-each>
+                                        </stentry>
+                                    </xsl:if>
+                                    <xsl:if test="$group.count">
+                                    <stentry props="group.count" current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"  audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}">
+                                            <xsl:call-template name="p5gnuplot:set.graph.group">
+                                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                                <xsl:with-param name="group__x3A__value" select="$group.count"/>
+                                            </xsl:call-template>
+                                            <xsl:for-each select="current-group()">
+                                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                                </xsl:apply-templates>
+                                            </xsl:for-each>
+                                        </stentry>
+                                    </xsl:if>
+                                </xsl:for-each-group>
+                        
+                        
+                
+                <xsl:if test="$group.count__x3A__path__x3A__length">
+                    <stentry props="group.count__x3A__path__x3A__length" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
+                        <xsl:call-template name="p5gnuplot:set.graph.group">
+                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                            <xsl:with-param name="group__x3A__value" select="$group.count__x3A__path__x3A__length"/>
+                        </xsl:call-template>
                         
-                        <xsl:for-each-group select="current-group()" group-by="@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]"><!-- todo other -->
-                            <xsl:sort select="number(@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ])" data-type="number" order="ascending"/>
-                            <stentry props="group.count" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">
-                                <xsl:call-template name="p5gnuplot:set.graph.group">
-                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                                    <xsl:with-param name="group__x3A__value" select="$group.count"/>
-                                </xsl:call-template>
-                                <xsl:for-each select="current-group()">
-                                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
-                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
-                                    </xsl:apply-templates>
-                                </xsl:for-each>
-                            </stentry>
-                            <stentry props="group.sum" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
-                                <xsl:call-template name="p5gnuplot:set.graph.group">
-                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                                    <xsl:with-param name="group__x3A__value" select="$group.sum"/>
-                                </xsl:call-template>
+                        <xsl:for-each select="current-group()">
+                            <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
                                 
-                                <xsl:for-each select="current-group()">
-                                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
-                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
-                                        
-                                    </xsl:apply-templates>
-                                </xsl:for-each>
-                            </stentry>
-                        </xsl:for-each-group>
-                    </xsl:for-each-group>
-                </xsl:when>
-                <xsl:otherwise>
-                    <xsl:for-each-group select="$system_cache__dita:context.path.attrs.nodeset/*/*" group-by="@*[name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by]"><!-- todo other -->
-                        <xsl:sort select="number(@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ])" data-type="number" order="ascending"/>
-                        <stentry props="group.count" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">
-                            <xsl:call-template name="p5gnuplot:set.graph.group">
-                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                                <xsl:with-param name="group__x3A__value" select="$group.count"/>
-                            </xsl:call-template>
-                            <xsl:for-each select="current-group()">
-                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
-                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
-                                </xsl:apply-templates>
-                            </xsl:for-each>
-                        </stentry>
-                        <stentry props="group.sum" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
-                            <xsl:call-template name="p5gnuplot:set.graph.group">
-                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                                <xsl:with-param name="group__x3A__value" select="$group.sum"/>
-                            </xsl:call-template>
-                            
-                            <xsl:for-each select="current-group()">
-                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
-                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
-                                    
-                                </xsl:apply-templates>
-                            </xsl:for-each>
-                        </stentry>
+                            </xsl:apply-templates>
+                        </xsl:for-each>
+                    </stentry>
+                </xsl:if>
+                
                     </xsl:for-each-group>
-                </xsl:otherwise>
-            </xsl:choose>
             
             
         </strow>

+ 68 - 42
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl

@@ -39,12 +39,22 @@
             <q props="p5gnuplot.current-grouping-key.xtics">rok|kwartał</q>
         </equation-inline>-->
         <!--<p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze>-->
-            <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze" select="doc(p5gnuplot:set.graph.stats.xml($fileindex))">
-                <xsl:with-param name="system_cache__dita:element__x3A__parent" select="$system_cache__dita:element__x3A__parent"/>
-                <xsl:with-param name="system_cache__dita:graph.ytics_detect_row" select="$system_cache__dita:graph.ytics_detect_row"/>
-                <xsl:with-param name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y"/>
-                <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
-            </xsl:apply-templates>
+        
+            <xsl:choose>
+                <xsl:when test="p5gnuplot:graph.stats.xml__x3A__detect__if__file_aviable($fileindex)">
+                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze" select="doc(p5gnuplot:set.graph.stats.xml($fileindex))">
+                        <xsl:with-param name="system_cache__dita:element__x3A__parent" select="$system_cache__dita:element__x3A__parent"/>
+                        <xsl:with-param name="system_cache__dita:graph.ytics_detect_row" select="$system_cache__dita:graph.ytics_detect_row"/>
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y"/>
+                        <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
+                        <xsl:with-param name="fid" select="@fid"/>
+                    </xsl:apply-templates>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:comment> #533 unaviable p5gnuplot:graph.stats.xml__x3A__detect__if__file_aviable($fileindex) = <xsl:value-of select="$fileindex"/> </xsl:comment>
+                </xsl:otherwise>
+            </xsl:choose>
+        
             
         <!--</p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze>-->
     </xsl:template>
@@ -63,6 +73,8 @@
         <xsl:param name="system_cache__dita:graph.ytics_detect_row"  required="yes"/>
         <xsl:param name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y"  required="yes"/>
         <xsl:param name="p5gnuplot:value"/>
+        <xsl:param name="fileindex"/>
+        <xsl:param name="fid"/>
         <!--<xsl:for-each-group select="stentry" group-by="@current-grouping-key">-->
             
         <xsl:variable name="system_cache__dita:element.next" select="system_cache__dita:element.next($system_cache__dita:element__x3A__parent)"/>
@@ -116,62 +128,71 @@
                         </dd>
                         
                         </dlentry>
-                        <dlentry>
-                            
-                            <dt>
-                                Analiza regresji liniowej 
-                            </dt>
-                            <dd>
-                                <xsl:variable name="Linear_regression:calculate_data">
-                                <xsl:call-template name="Linear_regression:calculate_data">
-                                    <!--<xsl:with-param name="Linear_regression:X_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingNumber</xsl:with-param>-->
-                                    <xsl:with-param name="Linear_regression:X_element__x3A__set">p5gnuplot:stats</xsl:with-param>
-                                    <xsl:with-param name="Linear_regression:Y_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month</xsl:with-param>
-                                    <xsl:with-param name="Linear_regression:dataset" select="current-group()"/>
-                                </xsl:call-template>
-                                </xsl:variable>
-                                <xsl:apply-templates mode="Linear_regression:calculate_data__x3A__to_dita" select="$Linear_regression:calculate_data"/>
-                                <foreign>
-                                    <xsl:copy-of select="$Linear_regression:calculate_data"/>
-                                </foreign>
-                        
-                            </dd>
-                        </dlentry>   
+                        <xsl:if test="count(current-group()) &gt; 3">
+                            <dlentry>
+                                <!--<xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+                                    <xsl:with-param name="fid" select="$fid"/>
+                                    <xsl:with-param name="fileindex" select="$fileindex"/>
+                                    <!-\-<xsl:with-param name="graph.name" select="@fid"/>-\->
+                                    <xsl:with-param name="system_cache__dita:element__x3A__name">dlentry</xsl:with-param>
+                                </xsl:call-template>-->
+                                
+                                <dt>
+                                    Analiza regresji liniowej 
+                                </dt>
+                                <dd>
+                                    <xsl:variable name="Linear_regression:calculate_data">
+                                    <xsl:call-template name="Linear_regression:calculate_data">
+                                        <!--<xsl:with-param name="Linear_regression:X_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingNumber</xsl:with-param>-->
+                                        <xsl:with-param name="Linear_regression:X_element__x3A__set">p5gnuplot:stats</xsl:with-param>
+                                        <xsl:with-param name="Linear_regression:Y_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month</xsl:with-param>
+                                        <xsl:with-param name="Linear_regression:dataset" select="current-group()"/>
+                                        <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
+                                    </xsl:call-template>
+                                    </xsl:variable>
+                                    <xsl:apply-templates mode="Linear_regression:calculate_data__x3A__to_dita" select="$Linear_regression:calculate_data"/>
+                                    <foreign>
+                                        <xsl:copy-of select="$Linear_regression:calculate_data"/>
+                                    </foreign>
+                                </dd>
+                                
+                            </dlentry>   
+                        </xsl:if>
                         
                         <xsl:choose>
-                            <xsl:when test="current-group()/text()">
+                            <xsl:when test="number(current-group()[1])">
                                 <dlentry>
                                     <dt>
                                         min/max
                                     </dt>
                                     <xsl:element name="dd">
                                         <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
-                                            Minimum <xsl:value-of select="system_cache__dita:big_values_format(min(current-group()/number(text())))"/>
-                                            <foreign>current-group()/name()= <xsl:value-of select="current-group()[1]/name()"/> , text()=<xsl:value-of select="text()"/></foreign>
+                                            Minimum: <b><xsl:value-of select="system_cache__dita:big_values_format(min(current-group()/number(text())))"/></b> 
+                                            <!--<foreign>current-group()/name()= <xsl:value-of select="current-group()[1]/name()"/> , text()=<xsl:value-of select="text()"/></foreign>-->
                                         </xsl:element>
-                                        <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
+                                        <!--<xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
                                             <xsl:value-of select="min(current-group()/number(text()))"/> 
                                             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
                                                 <xsl:with-param name="fid" select="current-group()[ text()=min(current-group()/number(text())) ][1]/@fid"/>
                                             </xsl:call-template>
-                                        </xsl:element>
+                                        </xsl:element>-->
                                     </xsl:element>
                                     <xsl:element name="dd">
                                         <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
-                                            Maximum <xsl:value-of select="system_cache__dita:big_values_format(max(current-group()/number(text())))"/> 
+                                            Maximum: <b><xsl:value-of select="system_cache__dita:big_values_format(max(current-group()/number(text())))"/></b> 
                                         </xsl:element>
                                         <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
                                             <xsl:with-param name="fid" select="current-group()[ max(number(text()))]/@fid"/>
                                         </xsl:call-template>
                                     </xsl:element>
                                     <xsl:element name="dd">
-                                        Średnia <xsl:value-of select="system_cache__dita:big_values_format(avg(current-group()/number(text())))"/> 
+                                        Średnia: <b><xsl:value-of select="system_cache__dita:big_values_format(avg(current-group()/number(text())))"/></b> 
                                     </xsl:element>
                                     <xsl:element name="dd">
-                                        Suma <xsl:value-of select="system_cache__dita:big_values_format(sum(current-group()/number(text())))"/> 
+                                        Suma: <b><xsl:value-of select="system_cache__dita:big_values_format(sum(current-group()/number(text())))"/></b> 
                                     </xsl:element>
                                     <xsl:element name="dd">
-                                        Ilość <xsl:value-of select="count(current-group()/number(text()))"/> 
+                                        Ilość: <b><xsl:value-of select="count(current-group()/number(text()))"/></b> 
                                     </xsl:element>
                                 </dlentry>
                             </xsl:when>
@@ -180,7 +201,7 @@
                                     <dt>
                                         wykrycie danych 
                                     </dt>
-                                    <dd>nieudane (brak wartości w zestawie danych)</dd>
+                                    <dd>nieudane (brak wartości w zestawie danych) [<!--<xsl:value-of select="current-group()//[1]text()[1]"/>-->]</dd>
                                 </dlentry>
                                 
                             </xsl:otherwise>
@@ -191,11 +212,14 @@
                     <xsl:when test="string-length($p5gnuplot:value)=0">
                         <xsl:comment>#155 going all </xsl:comment>
                         
-                        <xsl:for-each-group select="stentry/p5gnuplot:stats" group-by="parent::*/@props">
+                        <xsl:for-each-group select="current-group()[1]" group-by="parent::stentry/concat(@props,' ',@audience,' ',@group)"> <!-- stentry/p5gnuplot:stats -->
                             <dlentry>
                                 <dt>
-                                    min/max
+                                    poz. <xsl:value-of select="position()"/> <sup>(<xsl:value-of select="current-grouping-key()"/>)</sup> (<xsl:value-of select="position()"/>)
                                 </dt>
+                                <dd>
+                                    min/max 
+                                </dd>
                                 
                             <xsl:element name="dd">
                                 Suma <xsl:value-of select="system_cache__dita:big_values_format(sum(current-group()/number(text())))"/> 
@@ -204,13 +228,14 @@
                                 Ilość <xsl:value-of select="count(current-group()/number(text()))"/> 
                             </xsl:element>
                             </dlentry>
+                            <xsl:if test="count(current-group()) &gt;3">
                             <dlentry>
-                                <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+                                <!--<xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
                                     <xsl:with-param name="title">APU4_umowy</xsl:with-param>
                                     <xsl:with-param name="graph.name">GAD_Linear_Regres</xsl:with-param>
                                     <xsl:with-param name="system_cache__dita:element__x3A__name">dlentry</xsl:with-param>
                                     <xsl:with-param name="fid" select="@fid"/>
-                                </xsl:call-template>
+                                </xsl:call-template>-->
                                 <dt>
                                     Analiza regresji liniowej dla całości zakresu
                                 </dt>
@@ -220,12 +245,13 @@
                                             <xsl:call-template name="Linear_regression:calculate_data">
                                                 <xsl:with-param name="Linear_regression:X_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingNumber</xsl:with-param>
                                                 <xsl:with-param name="Linear_regression:Y_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month</xsl:with-param>
-                                                <xsl:with-param name="Linear_regression:dataset" select="current-group()"/>
+                                                <xsl:with-param name="Linear_regression:dataset" select="current()"/>
                                             </xsl:call-template>
                                         </xsl:variable>
                                         <xsl:apply-templates mode="Linear_regression:calculate_data__x3A__to_dita" select="$Linear_regression:calculate_data"/>
                                     </dd>
                             </dlentry>
+                            </xsl:if>
                         </xsl:for-each-group>
                         
                         

+ 7 - 3
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl

@@ -322,10 +322,14 @@
         
         
         
+        <xsl:choose>
+            <xsl:when test="p5gnuplot:graph.stats.xml__x3A__if_data_aviable_to_save($system_cache__dita:graph.stats)">
+                <xsl:result-document href="{p5gnuplot:set.graph.stats.xml($fileindex)}" >
+                    <xsl:copy-of select="$system_cache__dita:graph.stats"/>
+                </xsl:result-document>
+            </xsl:when>
+        </xsl:choose>
         
-        <xsl:result-document href="{p5gnuplot:set.graph.stats.xml($fileindex)}" >
-                <xsl:copy-of select="$system_cache__dita:graph.stats"/>
-        </xsl:result-document>
         
          <xsl:result-document href="{$ditadir}/graph_to_image/{$fileindex}.gnuplot.debug.xml" >
             <p5gnuplot:DEBUG xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot">

+ 16 - 1
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__detect.xsl

@@ -252,6 +252,12 @@
         <xsl:copy-of select="count(strow[ position() = 1]/stentry)"/>
     </xsl:template>
     
+    <xsl:function name="p5gnuplot:graph.stats.xml__x3A__detect__if__file_aviable">
+        <xsl:param name="fileindex"/>
+        <xsl:choose>
+            <xsl:when test="doc-available(p5gnuplot:set.graph.stats.xml($fileindex))"><xsl:value-of select="1"/></xsl:when>
+        </xsl:choose>
+    </xsl:function>
     
     <xsl:template name="system_cache__dita:graph.stats__x3A__detect">
         <xsl:copy-of select="strow[ contains(@props,'graph.stats')]"/>
@@ -318,6 +324,7 @@ unset xtics</xsl:text></xsl:when>
         <xsl:choose>
             <xsl:when test="contains(@props,'font30')"><xsl:value-of select="30"/><xsl:message>#54-A p5gnuplot:font__x3A__size 30</xsl:message></xsl:when>
             <xsl:when test="contains(@props,'font15')"><xsl:value-of select="15"/><xsl:message>#54-B p5gnuplot:font__x3A__size 15</xsl:message></xsl:when>
+            <xsl:when test="contains(@props,'font9')"><xsl:value-of select="9"/><xsl:message>#54-C p5gnuplot:font__x3A__size 9</xsl:message></xsl:when>
             <xsl:otherwise><xsl:value-of select="$p5gnuplot:font__x3A__size"/></xsl:otherwise>
         </xsl:choose>
     </xsl:template>
@@ -381,10 +388,18 @@ set xtics rotate
     <xsl:template name="system_cache__dita:graph.separate.outputs.auto__x3A__detect">
         <xsl:choose>
             <xsl:when test="contains(@props,'graph.separate.outputs.auto')"><xsl:value-of select="1"/></xsl:when>
-            <xsl:otherwise></xsl:otherwise>
+            <xsl:otherwise/>
         </xsl:choose>
     </xsl:template>
     
+    <xsl:function name="p5gnuplot:graph.stats.xml__x3A__if_data_aviable_to_save">
+        <xsl:param name="system_cache__dita:graph.stats"/>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita:graph.stats//*"><xsl:value-of select="1"/></xsl:when>
+            <xsl:otherwise><xsl:message>#382 unaviable data to save for $system_cache__dita:graph.stats </xsl:message></xsl:otherwise>
+        </xsl:choose>
+    </xsl:function>
+    
     <xsl:function name="p5gnuplot:graph.gnuplot.dita__x3A__if__x3A__aviable">
         <xsl:param name="fileindex"/>
         <xsl:choose>

+ 2 - 1
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__set.xsl

@@ -264,7 +264,7 @@ set output '</xsl:text><xsl:value-of select="$fileindex"/><xsl:text>.png'
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:FieldType" required="yes"/>
         
         <xsl:choose>
-            <xsl:when test="string-length($group__x3A__value) &gt;0">
+            <xsl:when test="string-length(string($group__x3A__value)) &gt;1">
                 <xsl:attribute name="group" select="concat($group__x3A__value,@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType])"/>
             </xsl:when>
         </xsl:choose>
@@ -279,6 +279,7 @@ set output '</xsl:text><xsl:value-of select="$fileindex"/><xsl:text>.png'
     
     <xsl:function name="p5gnuplot:set.gnuplot.debug.xtics.xml">
         <xsl:param name="fileindex"/>
+        <xsl:message>#262 called p5gnuplot:set.gnuplot.debug.xtics.xml with <xsl:value-of select="$fileindex"/>; fileindex.</xsl:message>
         <xsl:value-of select="concat($ditadir,'/graph_to_image/',$fileindex,'.gnuplot.debug.xtics.xml')"/>
     </xsl:function>
     

+ 2 - 0
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.localname.translate.xsl

@@ -33,6 +33,8 @@
             <xsl:when test="$localname='BI_audit_KRS'"> KRS </xsl:when>
             <xsl:when test="$localname='BI_audit_MSIG'"> MSIG </xsl:when>
             <xsl:when test="$localname='BI_audit_KRS_person'"> KRS/o </xsl:when>
+            <xsl:when test="$localname='KRS_address'"> KRS/adr. </xsl:when>
+            
             <xsl:when test="$localname='BI_audit_MSIG_person'"> MSIG/o </xsl:when>
             <xsl:when test="$localname='BI_audit_ENERGA_PRACOWNICY'"> Pracow. </xsl:when>
             <xsl:when test="$localname='BI_audit_ENERGA_RUM_KONTRAHENCI'"> Kontr/RUM </xsl:when>

+ 2 - 0
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita__x3A__to_merge.xsl

@@ -32,4 +32,6 @@
     
     <xsl:include href="Linear_regression/Linear_regression.xsl"/>
     
+    <xsl:include href="../math/sqrt.xsl"/>
+    
 </xsl:stylesheet>

+ 52 - 0
SE/schema/default_db_xml_cache.public/math/sqrt.xsl

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:math="http://exslt.org/math"
+    exclude-result-prefixes="xs"
+    version="2.0">
+    
+    
+    <xsl:function name="math:sqrt">
+        <xsl:param name="number"/>
+        <xsl:call-template name="math:sqrt">
+            <xsl:with-param name="number" select="$number"/>
+        </xsl:call-template>
+    </xsl:function>
+    
+    <xsl:template name="math:sqrt">
+        <!--  The number you want to find the square root of  -->
+        <xsl:param name="number"
+            select="0" />
+        <!--  The current 'try'.  This is used internally.  -->
+        <xsl:param name="try"
+            select="1" />
+        <!--  The current iteration, checked against maxiter to limit loop count  -->
+        <xsl:param name="iter"
+            select="1" />
+        <!--  Set this up to ensure against infinite loops  -->
+        <xsl:param name="maxiter"
+            select="10" />
+        <!--  This template was written by Nate Austin using Sir Isaac Newton's
+       method of finding roots  -->
+        <xsl:choose>
+            <xsl:when test="$try * $try = $number or $iter > $maxiter">
+                <xsl:value-of select="$try" />
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:call-template name="math:sqrt">
+                    <xsl:with-param name="number"
+                        select="$number" />
+                    <xsl:with-param name="try"
+                        select="$try - (($try * $try - $number) div (2 * $try))" />
+                    <xsl:with-param name="iter"
+                        select="$iter + 1" />
+                    <xsl:with-param name="maxiter"
+                        select="$maxiter" />
+                </xsl:call-template>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    
+    
+</xsl:stylesheet>

Fichier diff supprimé car celui-ci est trop grand
+ 1986 - 2
se.oxygen.xpr


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff