a.binder 7 سال پیش
والد
کامیت
db9ce041f5
26فایلهای تغییر یافته به همراه1099 افزوده شده و 173 حذف شده
  1. 18 1
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_BENFORD/default_db__x3A__BI_audit_BENFORD.BI_audit_BENFORD.NWK3.xsl
  2. 2 2
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_BENFORD/default_db__x3A__BI_audit_BENFORD.BI_audit_BENFORD.overwiev_table.xsl
  3. 21 0
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_BENFORD/default_db__x3A__BI_audit_BENFORD.BI_audit_BENFORD__x3A__generate.xsl
  4. 105 13
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.xsl
  5. 80 41
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl
  6. 48 3
      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
  7. 20 4
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_context.path.xsl
  8. 36 0
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row.xsl
  9. 145 7
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA.xsl
  10. 12 4
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.sources.xsl
  11. 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
  12. 1 0
      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
  13. 300 53
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl
  14. 24 2
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl
  15. 26 7
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics.xsl
  16. 62 1
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__detect.xsl
  17. 42 4
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__fix.xsl
  18. 67 8
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__set.xsl
  19. 23 0
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.xaxis.xsl
  20. 10 1
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.xsl
  21. 12 3
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat__x3A__init.xsl
  22. 2 2
      SE/schema/default_db_xml_cache.public/default_db/system_cache__dita__x3A__to_merge/tree_to_dita__x3A__platform.xsl
  23. 10 0
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.element.xsl
  24. 19 4
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.localname.translate.xsl
  25. 1 0
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita__x3A__to_merge.xsl
  26. 12 12
      se.oxygen.xpr

+ 18 - 1
SE/schema/default_db_xml_cache.public/default_db/BI_audit_BENFORD/default_db__x3A__BI_audit_BENFORD.BI_audit_BENFORD.NWK3.xsl

@@ -10,6 +10,7 @@
     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_UMOWY="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_UMOWY"
     xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+    xmlns:Linear_regression="https://en.wikipedia.org/wiki/Linear_regression"
     exclude-result-prefixes="p5gnuplot xs Benford system_cache__appinfo system_cache__dita get_wfs p5 xlink default_db__x3A__BI_audit_BENFORD"
     version="2.0">
     
@@ -51,11 +52,27 @@
                                     </sthead>
                                     <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:NWK3_table">
                                         <xsl:with-param name="groupField" select="."/>
-                                        <xsl:with-param name="context" select="$context"/>
+                                        <xsl:with-param name="context" select="$context//default_db__x3A__BI_audit_ENERGA_RUM_UMOWY:BI_audit_ENERGA_RUM_UMOWY"/>
                                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField" select="$default_db__x3A__BI_audit_BENFORD:valueField"/>
                                     </xsl:call-template>
                                 </simpletable>
                             </xsl:for-each>
+                        
+                        <p>
+                            <xsl:variable name="Linear_regression:calculate_data__x3A__to_dita">
+                                <xsl:call-template name="Linear_regression:calculate_data">
+                                    <xsl:with-param name="Linear_regression:dataset" select="$context"/>
+                                    <!--<xsl:with-param name="Linear_regression:X_attribute__x3A__set">Wartosc</xsl:with-param>-->
+                                    <xsl:with-param name="Linear_regression:X_element__x3A__set">Wartosc</xsl:with-param>
+                                    <!--<xsl:with-param name="Linear_regression:Y_attribute__x3A__set">Data_zawarcia</xsl:with-param>-->
+                                    <xsl:with-param name="Linear_regression:Y_element__x3A__set">Data_zawarcia</xsl:with-param>
+                                </xsl:call-template>
+                            </xsl:variable>
+                            <foreign>
+                                <xsl:copy-of select="$Linear_regression:calculate_data__x3A__to_dita"></xsl:copy-of>
+                            </foreign>
+                            <xsl:apply-templates mode="Linear_regression:calculate_data__x3A__to_dita" select="$Linear_regression:calculate_data__x3A__to_dita"/>
+                        </p>
                     </body>
                 </topic>
             </xsl:result-document>

+ 2 - 2
SE/schema/default_db_xml_cache.public/default_db/BI_audit_BENFORD/default_db__x3A__BI_audit_BENFORD.BI_audit_BENFORD.overwiev_table.xsl

@@ -84,7 +84,7 @@
         <xsl:variable name="context" select="."/>
         <section>
             <title >(BG1)</title>
-            <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1* 1* 1* " props="nograph">
+            <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1* 1*" props="nograph">
                 <sthead>
                     <stentry>Pierwsze cyfry</stentry>
                     <!--<stentry>Stopień analizy</stentry>-->
@@ -114,7 +114,7 @@
         <xsl:variable name="simpletable" >
         <section>
             <title >(BG2T-<xsl:value-of select="$default_db__x3A__BI_audit_BENFORD:secondStep.leadingNumber"/>)</title>
-            <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1* 1* 1* " props="nograph">
+            <simpletable frame="all" relcolwidth="1* 1* 1* 1* 1* 1*  " props="nograph">
                 <sthead>
                     <stentry>Pierwsze cyfry</stentry>
                     <!--<stentry>Stopień analizy</stentry>-->

+ 21 - 0
SE/schema/default_db_xml_cache.public/default_db/BI_audit_BENFORD/default_db__x3A__BI_audit_BENFORD.BI_audit_BENFORD__x3A__generate.xsl

@@ -130,4 +130,25 @@
     
     <xsl:template mode="default_db__x3A__BI_audit_BENFORD:generate.leadingNumber" match="text()|comment()"/>
     
+    
+    <xsl:template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs">
+        <!-- to copy attributes -->
+        <xsl:apply-templates mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs" select="@*"/>
+    </xsl:template>
+    
+    
+    <xsl:template mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs" match="@default_db__x3A__BI_audit_BENFORD:leadingTime|@default_db__x3A__BI_audit_BENFORD:leadingTimeYear|@default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month|@default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    <xsl:template mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs" match="@default_db__x3A__BI_audit_BENFORD:leadingNumber">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    <xsl:template mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs" match="@default_db__x3A__BI_audit_BENFORD:leadingGroup|@default_db__x3A__BI_audit_BENFORD:leadingGroupText">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
+    
+    
+    <xsl:template mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs" match="@*"/>
+    
 </xsl:stylesheet>

+ 105 - 13
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.xsl

@@ -40,6 +40,7 @@
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:AddressField" required="yes" tunnel="yes" />
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:PeselField" required="yes" tunnel="yes" />
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" required="yes" tunnel="yes" />
+        <xsl:param name="group-by-attr" select="'fid'"/>
         <!--<xsl:param name="system_cache__dita:bypass_pos_grouping"/>-->
         <!--<xsl:variable name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed">
             <xsl:choose>
@@ -82,7 +83,7 @@
         
         <xsl:for-each select="$sources/sources/source">
             <xsl:variable name="source" select="."/>
-            <xsl:message>#2555 system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal zrodlo = <xsl:value-of select="."/></xsl:message>
+            <xsl:message>#2555 system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal zrodlo = <xsl:value-of select="."/>;  $group-by-attr=<xsl:value-of select="$group-by-attr"/>; $title=<xsl:value-of select="$title"/>; </xsl:message>
             <topichead > <!-- navtitle="żródło:{.}  Powiązania do osób z KRS ogólnie" -->
                 <xsl:attribute name="navtitle"><xsl:value-of select="."/> - <xsl:value-of select="$navtitle"/></xsl:attribute>
                 <xsl:attribute name="props">name__universal <xsl:value-of select="$title"/></xsl:attribute>
@@ -93,7 +94,7 @@
                     <xsl:attribute name="toc" select="$toc"/>
                 </xsl:if>
                 <xsl:if test="$keys"><xsl:attribute name="keys" select="$keys"/></xsl:if>
-                <xsl:for-each select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq//uniq[@source=$source]">
+                <xsl:for-each-group select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq//uniq[@source=$source]" group-by="@*[name()=$group-by-attr]">
                     <!--<xsl:variable name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.groupset">
                         <xsl:call-template name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.groupset">
                             <xsl:with-param name="interested_row" select="$interested_row"/>
@@ -101,14 +102,18 @@
                         </xsl:call-template>
                     </xsl:variable>-->
                     <!--<xsl:for-each select=""></xsl:for-each>--><!-- $interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() = 1]/*[ position() = 1 and ( source= $source or not(source)) ]]/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object/*[ position() = 1 and  (  $element='*'  or  local-name()=$element ) and system_cache__dita:files.key.DETECT(@fid,'','','') = current()/@key ] -->
-                    <xsl:for-each-group select="$interested_row/interested_row//*[  current()/@fid =  @fid]" 
-                        group-by="@fid">
+                    <xsl:variable name="group-by-attr.fids">
+                        <xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.uniq//uniq[@source=$source and @*[name()=$group-by-attr]=current()/@*[name()=$group-by-attr]]/@fid"/>
+                    </xsl:variable>
+                    <xsl:message>#105 $T=<xsl:value-of select="$title"/> RfidG=<xsl:value-of select="@*[name()=$group-by-attr]"/>; @fid=<xsl:value-of select="@fid"/>;  $group_fid $group-by-attr.fids =<xsl:value-of select="$group-by-attr.fids"/></xsl:message>
+                    <xsl:for-each-group select="$interested_row/interested_row//*[  current()/@*[name()=$group-by-attr] =  @*[name()=$group-by-attr]]" 
+                        group-by="@*[name()=$group-by-attr]">
                         <xsl:variable name="group_name" select="system_cache__dita:files.key.DETECT(@fid,'','','')"/>
                         <!--<topichead navtitle="{BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() = last()]/*/concat(Pelna_nazwa_kontrahenta,' ',Miejscowosc,' ',NIP)} powiązań ({ count( current-group())}) ">-->
                         
                         <!--<xsl:choose>
                                         <xsl:when test="//BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_old/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = last()]/BI_audit_ENERGA_RUM_KONTRAHENCI/ID=$BI_audit_ENERGA_RUM_KONTRAHENCI.ID">-->
-                        <xsl:message>
+                        <xsl:message> $group-by-attr = <xsl:value-of select="$group-by-attr"/> ; #/cg=<xsl:value-of select="count(current-group())"/>; current-grouping-key()=<xsl:value-of select="current-grouping-key()"/>; @fid=<xsl:value-of select="@fid"/>
                             #533-2595 $title=<xsl:value-of select="$title"/>; @generate-id=<xsl:value-of select="@generate-id"/>; counting ile ** <xsl:value-of select="count($system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed//fixed[@key = $group_name])"/>; $group_name=<xsl:value-of select="$group_name"/></xsl:message>
                         <xsl:choose> <!-- testowanie czy jest w roznych zrodlach ten sam pesel -->
                             <xsl:when test="count($system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed//fixed[@key = $group_name]) &gt;= 1">
@@ -140,6 +145,7 @@
                                                     <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="mode" select="$mode" tunnel="yes"/>
                                                 </xsl:apply-templates>
                                             </xsl:when>
                                             <xsl:when test="$mode = 'BI_audit_ENERGA_RUM_KONTRAHENCI'">
@@ -148,6 +154,7 @@
                                                     <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="mode" select="$mode" tunnel="yes"/>
                                                 </xsl:apply-templates>
                                             </xsl:when>
                                             <xsl:when test="$mode = 'system_cache__dita:ANALIZA_UMOW_4UA'">
@@ -168,6 +175,7 @@
                                                     <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 = 'system_cache__dita:ANALIZA_UMOW_4UA_preprocess'">
@@ -188,7 +196,7 @@
                                                     <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>
                                             
@@ -212,6 +220,7 @@
                                                     <xsl:with-param name="interested_row" select="$interested_row"/>
                                                     <xsl:with-param name="source" select="$source"/>
                                                     <xsl:with-param name="current-grouping-key" select="current-grouping-key()"/>
+                                                    <xsl:with-param name="mode" select="$mode" tunnel="yes"/>
                                                 </xsl:apply-templates>
                                                 <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row" select="." >
                                                     <xsl:with-param name="group_name" select="$group_name"/>
@@ -231,6 +240,7 @@
                                                     <xsl:with-param name="interested_row" select="$interested_row"/>
                                                     <xsl:with-param name="source" select="$source"/>
                                                     <xsl:with-param name="current-grouping-key" select="current-grouping-key()"/>
+                                                    <xsl:with-param name="mode" select="$mode" tunnel="yes"/>
                                                 </xsl:apply-templates>
                                             </xsl:when>
                                             
@@ -249,6 +259,7 @@
                                                     <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="mode" select="$mode" tunnel="yes"/>
                                                 </xsl:apply-templates>
                                             </xsl:otherwise>
                                         </xsl:choose>
@@ -280,6 +291,7 @@
                                             <xsl:with-param name="resulset" select="$resulset"/>
                                             <xsl:with-param name="title" select="concat($title,$source)"/>
                                             <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="mode" select="$mode" tunnel="yes"/>
                                         </xsl:apply-templates>
                                     </xsl:when>
                                     <xsl:when test="$mode = 'BI_audit_ENERGA_RUM_KONTRAHENCI'">
@@ -289,6 +301,7 @@
                                             <xsl:with-param name="resulset" select="$resulset"/>
                                             <xsl:with-param name="title" select="concat($title,$source)"/>
                                             <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="mode" select="$mode" tunnel="yes"/>
                                         </xsl:apply-templates>
                                     </xsl:when>
                                     <xsl:otherwise>
@@ -301,7 +314,7 @@
                             </xsl:otherwise>
                         </xsl:choose> 
                     </xsl:for-each-group>
-                </xsl:for-each>
+                </xsl:for-each-group>
             </topichead>
         </xsl:for-each>
         
@@ -382,7 +395,7 @@
                 <uicontrol><varname>liczba</varname></uicontrol>
                 <uicontrol><xsl:choose>
                     <xsl:when test="$count">
-                        <xsl:text> </xsl:text><xsl:value-of select="$count"/><xsl:text> </xsl:text>
+                        <xsl:text> </xsl:text><xsl:value-of select="$count"/>.<xsl:text> </xsl:text>
                     </xsl:when>
                     <xsl:otherwise>
                         <xsl:text> </xsl:text><xsl:value-of select="count( current-group())"/><xsl:text> </xsl:text>
@@ -469,9 +482,18 @@
     
     <xsl:template mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body" match="*">
         <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="count"/>
         <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>
+                <xsl:when test="string-length($system_cache__dita:element__x3A__parent) = 0">p</xsl:when>
+                <xsl:when test="$system_cache__dita:element__x3A__parent='p'">lq</xsl:when>
+                <xsl:when test="$system_cache__dita:element__x3A__parent='equation-inline'">q</xsl:when>
+                <xsl:otherwise>p</xsl:otherwise>
+            </xsl:choose>-->
+        </xsl:variable>
         <xsl:choose>
             <xsl:when test="Numer_kontrahenta/text()|ID/text()|source/text()|jednostka_organizacyjna/text()">
                <sup><ph>
@@ -598,7 +620,8 @@
         <xsl:choose>
             <xsl:when test="TERYT_names/*">
                 <xsl:for-each select="TERYT_names">
-                    <p>
+                    <xsl:element name="{$system_cache__dita:paragraph_allowed_element__x3A__calculated}">
+                    
                         <sup>
                         <xsl:choose>
                             <xsl:when test="last() &gt; 0"><i> teryt. adres: </i></xsl:when>
@@ -614,13 +637,15 @@
                         <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>
-                    </p>
+                    
+                    </xsl:element>
                 </xsl:for-each>
             </xsl:when>
         </xsl:choose>
         <xsl:choose>
             <xsl:when test="BI_audit_taxpayer   or $context/BI_audit_taxpayer">
-                <p>
+                <xsl:element name="{$system_cache__dita:paragraph_allowed_element__x3A__calculated}">
+                
                     <!--<dl>-->
                         <!--<dlentry>-->
                             <!--<dt>-->
@@ -647,9 +672,9 @@
                             <!--</dd>-->
                         <!--</dlentry>-->
                     <!--</dl>-->
-                </p>
                 
                 
+                </xsl:element>
             </xsl:when>
         </xsl:choose>
         
@@ -673,6 +698,8 @@
                 <strow>
                     <stentry><xsl:value-of select="position()"/></stentry>
                     <stentry>
+                        
+                        
                         <xsl:choose>
                             <xsl:when test="relation_from/text()">
                                 <sup><xsl:value-of select="system_cache__dita:localname.translate(relation_from)"/></sup>
@@ -683,6 +710,50 @@
                             <xsl:otherwise>
                                 <sup>inny</sup>
                             </xsl:otherwise>
+                        </xsl:choose>
+                        <xsl:choose>
+                            <xsl:when test="relation_DateRangeElements">
+                                
+                                    
+                                
+                                <dl>
+                                    <dlentry>
+                                    <dt/>
+                                        
+                                        <dt>Relacja w czasie</dt>
+                                    <xsl:choose>
+                                        <xsl:when test="relation_DateRangeElements/@leadingTimeDate-From">
+                                            <dd>
+                                                od dnia <xsl:value-of select="relation_DateRangeElements/@leadingTimeDate-From"/>
+                                            </dd>
+                                        </xsl:when>
+                                    </xsl:choose>
+                                    <xsl:choose>
+                                        <xsl:when test="relation_DateRangeElements/@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>
+                                                <xsl:otherwise>
+                                                    <dd>
+                                                        n. określ.
+                                                    </dd>
+                                                </xsl:otherwise>
+                                            </xsl:choose>
+                                            
+                                            
+                                            
+                                        </xsl:when>
+                                    </xsl:choose>
+                                    </dlentry>
+                                </dl>
+                                
+                                
+                            </xsl:when>
+                            
+                            
                         </xsl:choose>
                         <!--<foreign>
                             
@@ -714,6 +785,9 @@
                             <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>
+                          
+                          
+                          
                         </p>
                         <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.body"/>
                      <!--   <xsl:variable name="system_cache__dita:localname.translate">
@@ -755,7 +829,25 @@
                                 </xsl:for-each>
                             </xsl:otherwise>
                         </xsl:choose>-->
-                        
+                        <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:call-template>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    [<xsl:value-of select="count(parent::*//*[last()]/*[1]/*)"/>]
+                                </xsl:otherwise>
+                            </xsl:choose>
+                            
+                            
+                            
+                            
+                        </xsl:if>
                     </stentry>
                 </strow>
                 <!--<xsl:choose>

+ 80 - 41
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl

@@ -40,7 +40,7 @@
         <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="mode" required="yes" tunnel="yes"/>
         <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"/>
@@ -102,6 +102,7 @@
         <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:comment>#32 system_cache__dita:ANALIZA_UMOW_4UA $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}"><!-- group_name="{$group_name}" -->
@@ -167,13 +168,15 @@
                                     <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"/>
                                 </foreign>
                                 
-                                <dl>
-                                    <dlentry props="do_171">
-                                        <dt>Kontekty </dt>
-                                        <dd>Przejścia do obiektów w innych kontekstach</dd>
-                                    </dlentry>
+                            
                                     
                                     <xsl:if 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">
+                                        <dl>
+                                            <dlentry props="do_171">
+                                                <dt> Powiązanie kotenkstowe </dt>
+                                                <dd></dd>
+                                            </dlentry>
+                                        
                                         <dlentry props="do_200">
                                             <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"/>
@@ -182,11 +185,10 @@
                                                 <xsl:with-param name="system_cache__dita:element__x3A__surrounding.title">dt</xsl:with-param>
                                             </xsl:call-template>
                                         </dlentry>
-                                        
+                                        </dl>
                                     </xsl:if>
                                     
                                     
-                                </dl>
                                 
                                         
                                 
@@ -371,6 +373,18 @@
                     </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: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">
                         <stentry current-grouping-key="{@fid}" audience="powiazania">ilość powiązań</stentry>
@@ -420,21 +434,26 @@
                     <xsl:with-param name="simpletable" select="$simpletable"/>
                     <xsl:with-param name="title"> (APU4-T) powiązania tabela </xsl:with-param>
                 </xsl:call-template>-->
-                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
-                    <!--<xsl:with-param name="title"> (APU4-T) powiązania tabela </xsl:with-param>-->
+                <!-- tabela todo  -->
+                <!--<xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
+                    <!-\-<xsl:with-param name="title"> (APU4-T) powiązania tabela </xsl:with-param>-\->
                     <xsl:with-param name="title" select="$title"/>
-                </xsl:apply-templates>
+                </xsl:apply-templates>-->
                 
                 <p> (APU4) powiązania wykres </p>
                 <foreign>
                     <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
                 </foreign>
-                <p>   <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
+                <p>
+                    <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
                     <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                     <xsl:with-param name="width" select="250"/>
                     <xsl:with-param name="path.prefix">../</xsl:with-param>
                 </xsl:apply-templates>
                 </p>
+                <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">
@@ -626,21 +645,21 @@
                     <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"> (APU4-DT) umowy obiektu tabela </xsl:with-param>
+                    <xsl:with-param name="title" select="$title"/>
                     <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                 </xsl:apply-templates>
-                <p> (<xsl:value-of select="$graph.name"/>) umowy obiektu wykres </p>
+                <xsl:comment>#651</xsl:comment>
+                <!--<p> (<xsl:value-of select="$graph.name"/>) umowy obiektu wykres </p>-->
                 <foreign>
                     <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
                 </foreign>
-                <p> 
-                    
+                <!--<p>--> 
                   <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
                     <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                     <xsl:with-param name="width" select="250"/>
                     <xsl:with-param name="path.prefix">../</xsl:with-param>
                 </xsl:apply-templates>
-                </p>
+                <!--</p>-->
             </xsl:when>
             <xsl:otherwise>
                 <!--<p props="214a">
@@ -696,6 +715,10 @@
                         </xsl:for-each-group>
                         
                     </strow>
+                    
+                    
+                   
+                    
                     <strow props="graph.title">
                         <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.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"/>
@@ -779,11 +802,12 @@
                     <xsl:with-param name="title"> (APU4-DT) umowy obiektu tabela </xsl:with-param>
                 </xsl:call-template>-->
                 <!--<p>-->
-                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
+                <!-- tabela todo  -->
+                <!--<xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
                     <xsl:with-param name="title" select="$title"/>
-                    <!--<xsl:with-param name="title"> (APU4-DKT) umowy koszty obiektu tabela </xsl:with-param>-->
+                    <!-\-<xsl:with-param name="title"> (APU4-DKT) umowy koszty obiektu tabela </xsl:with-param>-\->
                     <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
-                </xsl:apply-templates>
+                </xsl:apply-templates>-->
                 <!--</p>-->
                 <!--<p>--> (<xsl:value-of select="$graph.name"/>) umowy koszty obiektu wykres <!--</p>-->
                 <foreign>
@@ -811,15 +835,16 @@
         <xsl:param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.related.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-DPW'"/>
+        <xsl:param name="mode" tunnel="yes" required="yes"/>
         <!--<strow>
             <xsl:copy-of select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset"/>
         </strow>-->
         <xsl:variable name="SIMPLETABLE_WTITLE">
             <SIMPLETABLE_WTITLE>
                 <simpletable frame="all"
-                    
-                    props="print__no graph.ylabel.Y graph.y2label.wartosc graph.style.histogram graph.style.histogram  no.logscale.y1 no.logscale.y2 font15 graph.separate.outputs.auto "><!-- graph.style.histogram.rowstacked --><!-- id="ANALIZA_UMOW_4UA.DW.graph.related.deals_table_2_5_{$generate_id}_{$title}" --><!-- font15 -->
+                    props="graph.ylabel.Y graph.y2label.wartosc graph.style.histogram graph.style.histogram  no.logscale.y1 no.logscale.y2 font15 graph.separate.outputs.auto  "><!-- --><!-- print__no graph.style.histogram.rowstacked --><!-- id="ANALIZA_UMOW_4UA.DW.graph.related.deals_table_2_5_{$generate_id}_{$title}" --><!-- font15 -->
                     <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="graph.name" select="$graph.name"/>
@@ -828,12 +853,13 @@
                     <strow props="graph.headers">
                         <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.related.childs.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"/>
-                            <stentry  current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" props="graph.xtic" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)}"><xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>
+                            <stentry  current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" props="graph.xtic" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($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="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></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="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></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 ]}" platform="{system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)}"><xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>
-                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)}"><xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>
+                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($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="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>
+                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($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="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
@@ -842,24 +868,34 @@
                             <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: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()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/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: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: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="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>
                             </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.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="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>
+                    
                     <strow props="graph.title">
                         <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.related.childs.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"/>
                             <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" group="rozklad" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">rozkład</stentry>-->
-                            <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" group="koszt.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape('default_db__x3A__BI_audit_BENFORD:leadingNumber')}" props="sum">koszt.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry><!--<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>-->
+                            <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" group="koszt.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape('default_db__x3A__BI_audit_BENFORD:leadingNumber')}" props="sum"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>koszt.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry><!--<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>-->
                             <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 ]}" group="iloscB.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape('default_db__x3A__BI_audit_BENFORD:leadingNumber')}" props="count">ilość B.<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry><!--<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>-->
-                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" group="kosztB.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape('default_db__x3A__BI_audit_BENFORD:leadingNumber')}" props="sum">koszt B.<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry><!--<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>-->
+                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" group="iloscB.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape('default_db__x3A__BI_audit_BENFORD:leadingNumber')}" props="count"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>ilość B.<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry><!--<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>-->
+                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" group="kosztB.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape('default_db__x3A__BI_audit_BENFORD:leadingNumber')}" props="sum"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>koszt B.<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry><!--<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>-->
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
@@ -959,21 +995,24 @@
                     <xsl:with-param name="simpletable" select="$simpletable"/>
                     <xsl:with-param name="title"> (APU4-DPT) umowy pośrednio powiązane z obiektem - tabela </xsl:with-param>
                 </xsl:call-template>-->
-                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
-                    <!--<xsl:with-param name="title"> (APU4-DPT) umowy pośrednio powiązane z obiektem - tabela </xsl:with-param>-->
+                <!--<xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
+                    <!-\-<xsl:with-param name="title"> (APU4-DPT) umowy pośrednio powiązane z obiektem - tabela </xsl:with-param>-\->
                     <xsl:with-param name="title" select="$title"/>
                     <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
-                </xsl:apply-templates>
-                 (<xsl:value-of select="$graph.name"/>) umowy pośrednio powiązane z obiektem 
-                <foreign>
-                    <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
-                </foreign>
+                </xsl:apply-templates>-->
+                <!--<p>-->(<xsl:value-of select="$graph.name"/>) umowy pośrednio powiązane z obiektem<!--</p>--> 
+                <!--<xsl:if test="$mode='system_cache__dita:ANALIZA_UMOW_4UA_preprocess'">-->
+                    <foreign>
+                        <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
+                    </foreign>
+                <!--</xsl:if>-->
+                <!--<p>-->
                   <xsl:apply-templates mode="system_cache__dita:graph__read" select="$simpletable">
                     <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                     <xsl:with-param name="width" select="250"/>
                     <xsl:with-param name="path.prefix">../</xsl:with-param>
                 </xsl:apply-templates>
-                
+                <!--</p>-->
                 <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>
@@ -1015,7 +1054,7 @@
         </ph>
     </xsl:template>
     
-    <xsl:template mode="system_cache__dita:ANALIZA_UMOW_4UA.title" match="*[@default_db__x3A__BI_audit_BENFORD:NameField]">
+    <xsl:template mode="system_cache__dita:ANALIZA_UMOW_4UA.title" match="*[@default_db__x3A__BI_audit_BENFORD:NameField and not(text())]">
         <ph> <xsl:value-of select="."/> </ph>
     </xsl:template>
     

+ 48 - 3
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

@@ -39,6 +39,9 @@
         <xsl:param name="fileindex"/>
         <xsl:param name="get_wfs:name_from_fid"/>
         <xsl:param name="foreign_fallback"/>
+        <xsl:param name="p5gnuplot:value"/>
+        <xsl:param name="props"/>
+        <xsl:param name="end_fid"/>
         <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>
@@ -47,7 +50,9 @@
             <xsl:if test="$fid"><xsl:value-of select="concat(',',$fid)"/></xsl:if>
             <xsl:if test="$fileindex"><xsl:value-of select="concat(',',$fileindex)"/></xsl:if>
             <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="$end_fid"><xsl:value-of select="concat(',','...',$end_fid)"/></xsl:if>
         </xsl:variable>
         <xsl:for-each select="tokenize($out,',')">
             <xsl:choose>
@@ -70,6 +75,9 @@
         <xsl:param name="fileindex"/>
         <xsl:param name="get_wfs:name_from_fid" select="get_wfs:name_from_fid($fid)"/>
         <xsl:param name="foreign_fallback"/>
+        <xsl:param name="p5gnuplot:value"/>
+        <xsl:param name="props"/>
+        <xsl:param name="end_fid"/>
             <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"/>
@@ -79,18 +87,54 @@
                     <xsl:with-param name="system_cache__dita:element__x3A__name" select="$system_cache__dita:element__x3A__name"/>
                     <xsl:with-param name="get_wfs:name_from_fid" select="$get_wfs:name_from_fid"/>
                     <xsl:with-param name="foreign_fallback" select="$foreign_fallback"/>
+                    <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:call-template>
             </xsl:attribute>
         
     </xsl:template>
     
-    <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+    <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__keydef">
         <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="get_wfs:name_from_fid" select="get_wfs:name_from_fid($fid)"/>
+        <xsl:param name="foreign_fallback"/>
+        <xsl:param name="p5gnuplot:value"/>
+        <xsl:param name="props"/>
+        <xsl:param name="href" required="yes"/><!-- to be detected -->
+        <xsl:param name="end_fid"/>
+        <keydef>
+            <xsl:attribute name="href" select="$href"/>
+            <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"/>
+                    <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="system_cache__dita:element__x3A__name" select="$system_cache__dita:element__x3A__name"/>
+                    <xsl:with-param name="get_wfs:name_from_fid" select="$get_wfs:name_from_fid"/>
+                    <xsl:with-param name="foreign_fallback" select="$foreign_fallback"/>
+                    <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:call-template>
+            </xsl:attribute>
+        </keydef>
         
+    </xsl:template>
+    
+    <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+        <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: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"/>
@@ -98,7 +142,8 @@
                 <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:attribute>
     </xsl:template>

+ 20 - 4
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_context.path.xsl

@@ -26,15 +26,31 @@
     
     
     <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs">
-        <xsl:param name="system_cache__dita:interested_row" required="yes"/>
+        <xsl:param name="system_cache__dita:interested_row" required="no"/>
         <xsl:param name="context" required="yes"/>
-        <xsl:attribute name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs" select="root()//BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position()=last() and child::*[@fid=current()/@fid ]] ]/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position()=1]/*[position()=1]/@fid"/><!-- *[ position()=1 and following-sibling::*[*[@fid = current()/@fid]] ] -->
+        <xsl:choose>
+            <xsl:when test="$context/local-name()='BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row'">
+                <xsl:attribute name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs" select="descendant-or-self::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:attribute name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs" select="root()//BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position()=last() and child::*[@fid=current()/@fid ]] ]/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position()=1]/*[position()=1]/@fid"/><!-- *[ position()=1 and following-sibling::*[*[@fid = current()/@fid]] ] -->
+            </xsl:otherwise>
+        </xsl:choose>
+        
     </xsl:template>
     
     <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs">
-        <xsl:param name="system_cache__dita:interested_row" required="yes"/>
+        <xsl:param name="system_cache__dita:interested_row" required="no"/>
         <xsl:param name="context" required="yes"/>
-        <xsl:attribute name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs" select="root()//BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position()=1 and child::*[@fid=current()/@fid ]] ]/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position()=last()]/*[position()=1]/@fid"/><!-- root()//*[ position()=last() and preceding-sibling::*[*[@fid = current()/@fid]] ]/@fid -->
+        <xsl:choose>
+            <xsl:when test="$context/local-name()='BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row'">
+                <xsl:attribute name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs" select="descendant-or-self::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid"/> 
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:attribute name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs" select="root()//BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position()=1 and child::*[@fid=current()/@fid ]] ]/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position()=last()]/*[position()=1]/@fid"/><!-- root()//*[ position()=last() and preceding-sibling::*[*[@fid = current()/@fid]] ]/@fid -->        
+            </xsl:otherwise>
+        </xsl:choose>
+        
     </xsl:template>
     
     <xsl:template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.row.attrs">

+ 36 - 0
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row.xsl

@@ -338,6 +338,42 @@
                                             <body>
                                                 <draft-comment author="a.binder">#1376a-1 $group_name=<xsl:value-of select="$group_name"/>; </draft-comment>
                                                 <!-- ancestor::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/@fid=<xsl:value-of select="ancestor::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/@fid"/>; /n=<xsl:value-of select="ancestor::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/name()"/>;  current-group()/ancestor-or-self::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/@fid=<xsl:value-of select="current-group()/ancestor-or-self::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/@fid"/>;;;;  ancestor-or-self::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/@fid=<xsl:value-of select="ancestor-or-self::BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/@fid"/>; -->
+                                                
+                                                <p>
+                                                   <!-- <xsl:choose>
+                                                        <xsl:when test="$system_cache__dita:bocian-graph-2-html.read.group='src'">-->
+                                                            <!--<xsl:variable name="graph_data">
+                                                                <xsl:element name="{BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[ position() = 1]/name()}">
+                                                                    <!-\-<BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA>-\->
+                                                                        <xsl:attribute name="fid" select="concat(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid,'_',$title)"/>
+                                                                        <xsl:copy-of select="current-group()" copy-namespaces="no"/>
+                                                                    <!-\-</BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA>-\->
+                                                                </xsl:element>
+                                                            </xsl:variable>-->
+                                                            <!--<xsl:comment>#2970-A-353 obrazek dla danego kontrahenta - grupa <xsl:value-of select="concat(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid,'_',$title)"/></xsl:comment>-->
+                                                            <!--<xsl:apply-templates mode="system_cache__dita:bocian-graph-2-html.read" select="$graph_data">
+                                                                <xsl:with-param name="fileindex" select="concat(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid,'_',$title)"/>
+                                                                <xsl:with-param name="map_or_indita" select="'topic'"/>
+                                                                <xsl:with-param name="width" select="500"/>
+                                                            </xsl:apply-templates>-->
+                                                       <!-- </xsl:when>
+                                                        <xsl:when test="$system_cache__dita:bocian-graph-2-html.read.group='dst'">
+                                                            <xsl:variable name="graph_data">
+                                                                <BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA>
+                                                                    <xsl:attribute name="fid" select="concat(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid,'_',$system_cache__dita:bocian-graph-2-html.read.group)"/>
+                                                                    <xsl:copy-of select="current-group()" copy-namespaces="no"/>
+                                                                </BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA>
+                                                            </xsl:variable>
+                                                            <xsl:comment>#2970-B obrazek dla danego kontrahenta - grupa <xsl:value-of select="concat(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid,'_',$system_cache__dita:bocian-graph-2-html.read.group)"/></xsl:comment>
+                                                            <xsl:apply-templates mode="system_cache__dita:bocian-graph-2-html.read" select="$graph_data">
+                                                                <xsl:with-param name="fileindex" select="concat(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid,'_',$system_cache__dita:bocian-graph-2-html.read.group)"/>
+                                                                <xsl:with-param name="map_or_indita" select="'topic'"/>
+                                                                <xsl:with-param name="width" select="500"/>
+                                                            </xsl:apply-templates>
+                                                        </xsl:when>
+                                                    </xsl:choose>-->
+                                                </p>
+                                                
                                                 <p>
                                                     <!--<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]"/>

+ 145 - 7
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA.xsl

@@ -40,9 +40,11 @@
         <!--<xsl:variable name="group_name_refpos.kon" select="concat(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() = last() ]/*[ position() = 1]/system_cache__appinfo:truncate_special_and_do_uppercase(concat(ID,Pelna_nazwa_kontrahenta)),'KONTR_DO')"/>-->
         <xsl:variable name="group_name_refpos.kon" select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[position() = last() ]/*[ position() = 1]/system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.DETECT.key(@fid,'KONTR_DO','',position())"/><!-- XX1 sure -->
         <xsl:variable name="refpos.kon" select="1"/>
+        
         <topicref toc="no"> <!-- 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:if test="string-length($system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.print.middle) &gt; 0 and not(position() = 1) and not(position() = last())">
                 <xsl:attribute name="print">
                     <!-- <xsl:choose>
@@ -63,10 +65,17 @@
             </xsl:attribute>
             <xsl:comment>#3063 system_cache__dita:files.href.context.title.keydef</xsl:comment>
             <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="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:call-template>
             <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">
                     <xsl:apply-templates mode="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.title" select="$context">
+                        <xsl:with-param name="title">APT-L </xsl:with-param>
                         <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.current"/>
                     </xsl:apply-templates>
                     <!--<title>Powiązań dla <xsl:value-of select="count( current-group())"/> dla  
@@ -78,11 +87,12 @@
                                 ;
                             </title>-->
                     
-                    <body><draft-comment author="a.binder">#2196  $system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@* = <xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current//@*"/>; EFO src/dst=<xsl:value-of select="$system_cache__dita:bocian-graph-2-html.read.group"/>; $context/fid=<xsl:value-of select="$context/@fid"/>; mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row" </draft-comment>
+                    <body><draft-comment author="a.binder">#2196 #c/cg=<xsl:value-of select="count(current-group())"/> $system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@* = <xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current//@*"/>; EFO src/dst=<xsl:value-of select="$system_cache__dita:bocian-graph-2-html.read.group"/>; $context/fid=<xsl:value-of select="$context/@fid"/>; mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row" </draft-comment>
                         <p>
                             
                             <xsl:choose>
                                 <xsl:when test="$system_cache__dita:bocian-graph-2-html.read.group='src'">
+                                    <xsl:message>#95 DEBUG GRAPH SRC FROM row_LISTA name <xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*/name()"/>; </xsl:message>
                                     <xsl:variable name="graph_data">
                                         <BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA>
                                             <xsl:attribute name="fid" select="concat(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid,'_',$system_cache__dita:bocian-graph-2-html.read.group)"/>
@@ -97,6 +107,7 @@
                                     </xsl:apply-templates>
                                 </xsl:when>
                                 <xsl:when test="$system_cache__dita:bocian-graph-2-html.read.group='dst'">
+                                    <xsl:message>#95 DEBUG GRAPH DST FROM row_LISTA name <xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*/name()"/>; </xsl:message>
                                     <xsl:variable name="graph_data">
                                         <BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA>
                                             <xsl:attribute name="fid" select="concat(BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[last()]/*[1]/@fid,'_',$system_cache__dita:bocian-graph-2-html.read.group)"/>
@@ -119,20 +130,141 @@
                                         <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>
+                                               <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>
+                                        
+                                        <equation-inline>
+                                            <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:apply-templates>
+                                        </equation-inline>
+                                    </equation-block>
+                                    
+                                    
+                                </xsl:if>
+                                <equation-block>
+                                    <equation-inline>
+                                        <tt><xsl:element name="{$system_cache__dita:subscript}">do</xsl:element></tt> 
+                                    </equation-inline>
+                                    <equation-inline>
+                                        <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>
+                                    
+                                    <equation-inline>
+                                        <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:apply-templates>
+                                    </equation-inline>
+                                </equation-block>
+                                
+                                
+                                
+                                
+                            </xsl:for-each-group>
+                            
                             
-                            <simpletable frame="all" relcolwidth="1* 1* 3* 5*" >
+                                <!--<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>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]/local-name()">
+                                <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><xsl:value-of select="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[1]/*[1]/@fid"/></stentry>-\->
                                         
                                         <stentry>
                                             <xref>
@@ -144,7 +276,7 @@
                                             </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())"/>-->
+                                            <!-\-<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
@@ -156,7 +288,7 @@
                                     </strow>
                                     
                                 </xsl:for-each-group>
-                            </simpletable>
+                            </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]"/>
@@ -171,6 +303,12 @@
         </topicref>
     </xsl:template>
     
+    
+    
+    
+    
+    
+    
     <xsl:template mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_LISTA" match="comment()|text()">
         <xsl:message>#3100 fixed text leackage</xsl:message>
     </xsl:template>

+ 12 - 4
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.sources.xsl

@@ -89,6 +89,14 @@
                             <xsl:attribute name="system_cache__dita:interested_row.path.generate-id">
                                 <xsl:value-of select="descendant-or-self::*[position()=1]/generate-id()"/>
                             </xsl:attribute>
+                            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs">
+                                
+                                <xsl:with-param name="context" select="."/>
+                            </xsl:call-template>
+                            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs">
+                                
+                                <xsl:with-param name="context" select="."/>
+                            </xsl:call-template>
                             <xsl:apply-templates mode="system_cache__dita:interested_row.id">
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField" tunnel="yes" select="$default_db__x3A__BI_audit_BENFORD:valueField" />
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:groupField" tunnel="yes" select="$default_db__x3A__BI_audit_BENFORD:groupField" />
@@ -273,14 +281,14 @@
                                         <xsl:attribute name="system_cache__dita:interested_row.path.generate-id">
                                             <xsl:value-of select="descendant-or-self::*[position()=1]/@generate-id"/>
                                         </xsl:attribute>
-                                        <!--<xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs">
+                                        <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs">
                                             <xsl:with-param name="system_cache__dita:interested_row" select="$interested_row"/>
                                             <xsl:with-param name="context" select="."/>
-                                        </xsl:call-template>-->
-                                        <!--<xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs">
+                                        </xsl:call-template>
+                                        <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs">
                                             <xsl:with-param name="system_cache__dita:interested_row" select="$interested_row"/>
                                             <xsl:with-param name="context" select="."/>
-                                        </xsl:call-template>-->
+                                        </xsl:call-template>
                                         <!--<xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.row.attrs">
                                             <xsl:with-param name="system_cache__dita:interested_row" select="$interested_row"/>
                                             <xsl:with-param name="context" select="."/>

+ 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="print__no  graph.style.histogram graph.ylabel.nazwa graph.lingstring.break.size.25">
+                    <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 -->
                         <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()}">

+ 1 - 0
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

@@ -853,6 +853,7 @@
                         <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:with-param name="group-by-attr">default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs</xsl:with-param>
                     </xsl:call-template>
                     
                 </topichead>

+ 300 - 53
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl

@@ -6,6 +6,8 @@
     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_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
+    xmlns:Linear_regression="https://en.wikipedia.org/wiki/Linear_regression"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -15,7 +17,9 @@
         <xsl:param name="fileindex" required="yes"/>
         <xsl:choose>
             <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: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:choose>
     </xsl:template>
@@ -26,57 +30,213 @@
     
     
     <xsl:template match="p5gnuplot:xtics" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
+        <xsl:param name="fileindex" required="yes" tunnel="yes"/>
         
+        <xsl:variable name="system_cache__dita:graph.ytics_detect_row" >
+            <xsl:choose>
+                <xsl:when test="doc-available(system_cache__dita:set.graph.ytics_detect_row.xml($fileindex))">
+                    <xsl:copy-of select="doc(system_cache__dita:set.graph.ytics_detect_row.xml($fileindex))"></xsl:copy-of>
+                </xsl:when>
+                <xsl:otherwise><xsl:message>#39 UNAVIABLE ERROR <xsl:value-of select="system_cache__dita:set.graph.ytics_detect_row.xml($fileindex)"/></xsl:message></xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+        <xsl:comment>#35 count $system_cache__dita:graph.ytics_detect_row = <xsl:value-of select="count($system_cache__dita:graph.ytics_detect_row//*)"/></xsl:comment>
         <dl props="match p5gnuplot xtics mode dita__x3A__analyze">
         <dlhead>
-            <dthd>opis znalezionych danych </dthd>
-            <ddhd>źródła danych,  osi, wartości, grupy, okresy</ddhd>
+            <dthd>GAD <sup>Graficzny analizator danych  </sup></dthd>
+            <ddhd><sup>opis znalezionych danych [źródła danych,  osi, wartości, grupy, okresy]</sup></ddhd>
         </dlhead>
+            
         
-            <xsl:for-each select=".//p5gnuplot:set.graph.separate.outputs.auto">
-                <dlentry>
-                <dt>Raster z wykresem</dt>
-                <dd><xsl:value-of select="@p5gnuplot:value"/><xsl:text> </xsl:text></dd>
-                    <dd><equation-inline>
-                        <image width="150" 
-                            href="{p5gnuplot:graph.output.image__x3A__detect__x3A__path(@p5gnuplot:value)}">
-                            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
-                                <xsl:with-param name="fileindex" select="@p5gnuplot:value"/>
-                            </xsl:call-template>
-                        </image>
+            <dlentry>
+                <dt>Parametry wspólne zakresu danych</dt>
+                
+                <dd props="detect_Y.all">
+                    <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+                        <xsl:with-param name="fileindex" select="$fileindex"/>
+                        <xsl:with-param name="system_cache__dita:element__x3A__name">dd</xsl:with-param>
+                        <xsl:with-param name="props">detect_Y.all</xsl:with-param>
+                    </xsl:call-template>
+                    <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>
+                </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">
+                        <xsl:with-param name="fileindex" select="$fileindex"/>
+                        <xsl:with-param name="system_cache__dita:element__x3A__name">dd</xsl:with-param>
+                        <xsl:with-param name="props">detect_X.all</xsl:with-param>
+                    </xsl:call-template>
+                    <equation-inline>
+                        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>
+                
+                
+                
+            </dlentry>
+            
+            
+        
+            <xsl:for-each select=".//p5gnuplot:set.graph.separate.outputs.auto">
+                <xsl:variable name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y">
+                    <xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" >
+                        <xsl:with-param name="p5gnuplot:value" select="@p5gnuplot:value"/>
+                    </xsl:call-template>
+                </xsl:variable>
+                <!--<xsl:variable name="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: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:variable>-->
+                <xsl:variable name="test_if_go_row">
+                    <test_if_go_row>
+                        <xsl:for-each-group select="doc(p5gnuplot:set.graph.stats.xml($fileindex))//p5gnuplot:stats" group-by="parent::*/@props">
+                            <ROW>
+                                <xsl:attribute name="name" select="name()"/>
+                                <xsl:attribute name="props" select="parent::*/@props"/>
+                            </ROW>
+                            <xsl:choose>
+                                <xsl:when test="current-group()[number()]">
+                                    <NUMBER/>
+                                </xsl:when>
+                            </xsl:choose>
+                            <xsl:variable name="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
+                                
+                                <xsl:call-template name="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
+                                    <xsl:with-param name="col" select="parent::*/@col"/>
+                                    <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:call-template>
+                                
+                                
+                            </xsl:variable>
+                            <xsl:choose>
+                                <xsl:when test="$system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect//@system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect and current-group()[number()]">
+                                    <DATA_AVIABLE/>
+                                </xsl:when>
+                            </xsl:choose>
+                            
+                        </xsl:for-each-group>
+                    </test_if_go_row>
+                </xsl:variable>
+                
+                
+                <xsl:choose>
+                    <xsl:when test="count($test_if_go_row//DATA_AVIABLE) &gt;0 and count($test_if_go_row//NUMBER) &gt;0">
+                        
                         
+                        
+                        <dlentry props="p5gnuplot.set.graph.separate.outputs.auto">
+                            <dt>Raster z wykresem </dt><!--(<xsl:value-of select="count($test_if_go_row//DATA_AVIABLE)"/>/<xsl:value-of select="count($test_if_go_row//NUMBER)"/>/<xsl:value-of select="count($test_if_go_row//ROW)"/>)[<xsl:value-of select="$test_if_go_row//@props"/>]-->
+                            <!--<dd><xsl:value-of select="@p5gnuplot:value"/><xsl:text> </xsl:text></dd>-->
+                            <dd><equation-inline>
+                                <image width="150" 
+                                    href="{p5gnuplot:graph.output.image__x3A__detect__x3A__path(@p5gnuplot:value)}">
+                                    <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+                                        <xsl:with-param name="fileindex" select="$fileindex"/>
+                                        <xsl:with-param name="p5gnuplot:value"  select="@p5gnuplot:value"/>
+                                    </xsl:call-template>
+                                </image>
+                            </equation-inline>
+                                
+                                
+                                
+                            </dd>  
+                            <dd>
+                                Opis wykresu
+                            </dd>
+                            <dd props="rowset.Y.used">
+                                <equation-inline>
+                                    Osie Y (użyte)
+                                </equation-inline>
+                                <equation-inline>
+                                    <!--<xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" >
+                                <xsl:with-param name="p5gnuplot:value" select="@p5gnuplot:value"/>
+                            </xsl:call-template>-->
+                                    <xsl:copy-of select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y/p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y/*"/>
+                                    <xsl:comment>#108 seopa</xsl:comment>
+                                    <!--<xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" >
+                                <xsl:with-param name="p5gnuplot:value" select="@p5gnuplot:value"/>
+                            </xsl:call-template>-->
+                                </equation-inline>
+                            </dd>
+                            
+                            
+                            
+                        </dlentry>
+                        
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:comment>#183 not data</xsl:comment>
+                    </xsl:otherwise>
+                </xsl:choose>
+                
+                
+              
                     
-                    </dd>  
-                    <dd>
-                        Opis wykresu
-                    </dd>
-                    <dd>
-                        <equation-inline>
-                            Osie Y
-                        </equation-inline>
-                        <equation-inline>
-                            <xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset" >
+                    
+                        
+                            <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"/>
+                                <xsl:with-param name="system_cache__dita:element__x3A__parent">equation-inline</xsl:with-param>
+                                <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:call-template>
-                        </equation-inline>
-                    </dd>
-                    <dd>
-                        Przeważające wartości
-                    </dd>
-                    <dd>
-                        Przeważające obiekty kontekstowe
-                    </dd>
-                    <dd>
+                            
+                        
+                    
+                   
+                
+                <dlentry>
+                    <dt>
                         Powiązania do innych elementów o podobnych cechach
-                    </dd>
+                    </dt>
                     <dd>
-                        Wnioski 
+                        <equation-inline>
+                            Wnioski
+                        </equation-inline>
                     </dd>
                 </dlentry>
             </xsl:for-each>
-        
+            <dlentry>
+                <dt>
+                    Podsumowanie całościowe
+                </dt>
+                <dd>
+                    <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"/>
+                            <xsl:with-param name="system_cache__dita:element__x3A__parent">equation-inline</xsl:with-param>
+                            <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:call-template>
+                        
+                    </equation-inline>
+                </dd>
+                
+                <dd>
+                    
+                </dd>
+                <dd>
+                    
+                    
+                </dd>
+            </dlentry>
         
         </dl>
     </xsl:template>
@@ -84,39 +244,126 @@
     
     
     
-    <xsl:template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset">
+    
+    
+    <xsl:template name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y">
+        <!--<xsl:param name="p5gnuplot:value" required="yes"/>-->
+        <xsl:param name="fileindex" required="yes" tunnel="yes"/>
+        <xsl:comment>#97-117 system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y</xsl:comment>
+        <!--<xsl:for-each select="">--><!-- root()//p5gnuplot:set.graph.separate.outputs.auto[@p5gnuplot:value=$p5gnuplot:value] -->
+        <xsl:apply-templates mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" select="doc(p5gnuplot:set.graph.dat.row__x3A__from__ytics.xml($fileindex))"/>
+        <!--</xsl:for-each>-->
+        
+    </xsl:template>
+    
+    
+    <xsl:template mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" match="p5gnuplot:dat.sthead">
+        
+        <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">
+            <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.yaxis.platform"/>
+        </q>
+        <markupname>
+            <xsl:value-of select="@p5gnuplot:value"/>
+        </markupname>
+    </xsl:template>
+    
+    
+    <!-- XXX --><!-- XXX --><!-- XXX --><!-- XXX --><!-- XXX -->
+    
+    <xsl:template name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X">
+        <xsl:param name="fileindex" required="yes" tunnel="yes"/>
+        <xsl:comment>#97 system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X</xsl:comment>
+        <!--<xsl:for-each select="">--><!-- root()//p5gnuplot:set.graph.separate.outputs.auto[@p5gnuplot:value=$p5gnuplot:value] -->
+        <xsl:apply-templates mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X" select="doc(p5gnuplot:set.graph.dat.row__x3A__from__ytics.xml($fileindex))"/>
+        <!--</xsl:for-each>-->
+        
+    </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="*">
+        <!--<xsl:comment>#111 matched X n/=<xsl:value-of select="name()"/></xsl:comment>-->
+        <xsl:apply-templates mode="#current"/>
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X" match="p5gnuplot:dat.sthead.ytics.row">
+        
+        <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_199_props">
+            <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.xaxis.props"/>
+        </ph>
+        <markupname>
+            <xsl:value-of select="@p5gnuplot:value"/>
+        </markupname>
+    </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()"/>
+    
+    
+    
+    <!-- NEW --><!-- NEW --><!-- NEW --><!-- NEW --><!-- NEW -->
+    
+    <xsl:template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y">
         <xsl:param name="p5gnuplot:value" required="yes"/>
         <xsl:comment>#68 p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset</xsl:comment>
         <!--<xsl:for-each select="">--><!-- root()//p5gnuplot:set.graph.separate.outputs.auto[@p5gnuplot:value=$p5gnuplot:value] -->
-        <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset" select="root()//*[p5gnuplot:set.graph.separate.outputs.auto[@p5gnuplot:value=$p5gnuplot:value]]"/>
+        <p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y>
+        <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" select="root()//*[p5gnuplot:set.graph.separate.outputs.auto[@p5gnuplot:value=$p5gnuplot:value]]">
+            <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
+        </xsl:apply-templates>
+        </p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y>
         <!--</xsl:for-each>-->
         
     </xsl:template>
     
     
-    <xsl:template mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset" match="text()|comment()"/>
+    <xsl:template mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" match="text()|comment()"/>
     
-    <xsl:template mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset" match="*">
+    <xsl:template mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" match="*">
+        <xsl:param name="p5gnuplot:value" required="yes"/>
         <!--<xsl:copy>-->
             <!--<xsl:copy-of select="@*"/>-->
-            <xsl:apply-templates mode="#current"/>
+            <xsl:apply-templates mode="#current">
+                <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
+            </xsl:apply-templates>
         <!--</xsl:copy>-->
     </xsl:template>
     
-    <xsl:template match="p5gnuplot:file.row.y" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset">
-        <ph props="p5gnuplot__file.row.y">  <xsl:value-of select="@p5gnuplot:value"/></ph>
+    <xsl:template match="p5gnuplot:file.row.y" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y">
+        <xsl:param name="p5gnuplot:value" required="yes"/>
+        <foreign audience="{@audience}">
+            <varname props="col"><xsl:value-of select="@col"/></varname>
+            <varname props="position"><xsl:value-of select="count(preceding::p5gnuplot:file.row.y[preceding::p5gnuplot:set.graph.separate.outputs.auto[@p5gnuplot:value=$p5gnuplot:value]])+1"/></varname>
+            <varname props="current-grouping-key"><xsl:value-of select="@current-grouping-key"/></varname>
+            <varname props="group"><xsl:value-of select="@group"/></varname>
+            <varname props="system_cache__dita:graph.ytics_detect_row"><xsl:value-of select="@system_cache__dita:graph.ytics_detect_row"/></varname>
+        </foreign>
+        
+        <ph props="p5gnuplot__file.row.y_241"><xsl:if test="count(preceding::p5gnuplot:file.row.y[preceding::p5gnuplot:set.graph.separate.outputs.auto[@p5gnuplot:value=$p5gnuplot:value]])&gt;0">, </xsl:if><xsl:value-of select="@col"/>) </ph>
+        <!--<tt>
+            <xsl:value-of select="@p5gnuplot:value"/>
+        </tt>-->
     </xsl:template>
-    <xsl:template match="p5gnuplot:set.logscale.y1[not(preceding::p5gnuplot:set.logscale.y1)]" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset">
-        <ph props="p5gnuplot__set.logscale.y1"><tt>oś Y1 logarytmiczna</tt></ph>
+    <xsl:template match="p5gnuplot:set.logscale.y1[not(preceding::p5gnuplot:set.logscale.y1)]" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y">
+        <ph props="p5gnuplot__set.logscale.y1">, <tt>oś Y1 logarytmiczna</tt> </ph>
     </xsl:template>
-    <xsl:template match="p5gnuplot:set.logscale.y2[not(preceding::p5gnuplot:set.logscale.y2)]" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset">
-        <ph props="p5gnuplot__set.logscale.y2"><tt>oś Y2 logarytmiczna</tt></ph>
+    <xsl:template match="p5gnuplot:set.logscale.y2[not(preceding::p5gnuplot:set.logscale.y2)]" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y">
+        <ph props="p5gnuplot__set.logscale.y2">, <tt> oś Y2 logarytmiczna </tt> </ph>
     </xsl:template>
     
-    <xsl:template match="p5gnuplot:current-grouping-key.xtics" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset">
-        <ph props="p5gnuplot.current-grouping-key.xtics">
-            <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@*"/>
-        </ph>
+    
+    <xsl:template match="p5gnuplot:current-grouping-key.xtics" mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y"/>
+        
+        
+    
+    <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">
+            <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.yaxis.platform"/>
+        </q>
         <!--<tt><xsl:value-of select="."/></tt>-->
     </xsl:template>
     
@@ -139,7 +386,7 @@
         </xsl:copy>
     </xsl:template>-->
     
-    <xsl:template mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset" match="p5gnuplot:set.graph.separate.outputs.auto">
+    <xsl:template mode="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" match="p5gnuplot:set.graph.separate.outputs.auto">
         <xsl:comment>#88-B found self bypass recurse</xsl:comment>
     </xsl:template>
     

+ 24 - 2
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl

@@ -121,9 +121,13 @@
     
     <xsl:include href="graph_gnuplot.simpletable__x3A__from_rows.xsl"/>
     
+    
+    
     <xsl:include href="graph_gnuplotdat.row__x3A__from__xtics__x3A__fix.xsl"/>
     <xsl:include href="graph_gnuplotdat__x3A__init.xsl"/>
     
+    <xsl:include href="graph_gnuplot.simpletable__x3A__graph.stats.xsl"/>
+    
     <xsl:function name="system_cache__dita:graph.title.group">
         <xsl:param name="current-grouping-key"/>
         <xsl:param name="graph.title"/>
@@ -311,10 +315,18 @@
         <xsl:param name="strow" required="yes"/>
         <xsl:param name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml" required="yes"/>
         <xsl:param name="system_cache__dita:graph.separate.outputs.auto" required="yes"/>
+        <xsl:param name="system_cache__dita:graph.stats" required="yes"/>
         <xsl:apply-templates mode="system_cache__dita:graph__write" select=".">
             <xsl:with-param name="fileindex" select="$fileindex"/>
         </xsl:apply-templates>
         
+        
+        
+        
+        <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">
                 <!--<xsl:copy-of select="$xtics.cols"/>-->
@@ -331,7 +343,7 @@
             </p5gnuplot:xtics>
         </xsl:result-document>
         
-        <xsl:result-document href="{$ditadir}/graph_to_image/{$fileindex}.gnuplot.debug.graph.ytics_detect_row.xml" >
+        <xsl:result-document href="{system_cache__dita:set.graph.ytics_detect_row.xml($fileindex)}"  ><!-- haref="{$ditadir}/graph_to_image/{$fileindex}.gnuplot.debug.graph.ytics_detect_row.xml" -->
             <p5gnuplot:graph.ytics_detect_row xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot">
                 <!--<xsl:copy-of select="namespace-uri()"/>-->
                 <!--<xsl:copy-of select="//namespace-uri()"/>-->
@@ -347,6 +359,16 @@
                 <xsl:copy-of select="$ytics"/>
             </p5gnuplot:graph.ytics>
         </xsl:result-document>
+        
+        <xsl:result-document href="{p5gnuplot:set.graph.dat.row__x3A__from__ytics.xml($fileindex)}"  ><!-- href2="{$ditadir}/graph_to_image/{$fileindex}.graph.dat.row__x3A__from__ytics.xml" -->
+            <!--<p5gnuplot:graph.ytics xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot">-->
+                <!--<xsl:copy-of select="$xtics.cols"/>-->
+                <!--<xsl:copy-of select="namespace-uri()"/>-->
+                <!--<xsl:copy-of select="//namespace-uri()"/>-->
+                <xsl:copy-of select="$system_cache__dita:graph.dat.row__x3A__from__ytics.xml"/>
+            <!--</p5gnuplot:graph.ytics>-->
+        </xsl:result-document>
+        
         <xsl:result-document href="{$ditadir}/graph_to_image/{$fileindex}.gnuplot.debug.title.xml" >
             <p5gnuplot:graph.ytics_detect_row xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot">
                 <xsl:copy-of select="namespace-uri()"/>
@@ -686,7 +708,7 @@ plot "</xsl:text><xsl:value-of select="$fileindex"/><xsl:text>.gnuplot.dat" usin
     </xsl:template>
     
     <xsl:template mode="system_cache__dita:graph__write" match="*">
-        <xsl:param name="fileindex" select="concat(ID,'_',local-name())"/>
+        <xsl:param name="fileindex"  required="yes"/><!-- select="concat(ID,'_',local-name())" -->
         <xsl:message>#122 system_cache__dita:graph__write <xsl:value-of select="$fileindex"/></xsl:message>
         <graph_to_image srcfile="{$ditadir}/graph_to_image/{$fileindex}.gnuplot" dstfile="{$ditadir}/graph_to_image/{$fileindex}.png.xml"  fileindex="{$fileindex}" ditadir="{$ditadir}"/> <!--  barchart.gnuplot="{$ditadir}/graph_to_image/{$fileindex}.gnuplot" population.dat.dita="{$ditadir}/{$fileindex}.dat" barchart.png.dita="{$ditadir}/{$fileindex}.png" --> 
     </xsl:template>

+ 26 - 7
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics.xsl

@@ -34,14 +34,15 @@
         <xsl:param name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" required="yes"/>
         <xsl:param name="system_cache__dita:graph.lingstring__x3A__break.size" required="yes"/>
         <xsl:param name="graph.data" required="yes" tunnel="yes"/>
-        <xsl:param name="graph.headers" required="yes"/>
-        <xsl:param name="graph.title" required="yes"/>
+        <xsl:param name="graph.headers" required="yes" tunnel="yes"/>
+        <xsl:param name="graph.title" required="yes" tunnel="yes"/>
         <xsl:param name="ytics" required="yes" tunnel="yes"/>
         <xsl:param name="system_cache__dita:graph.ytics_detect_row" required="yes" tunnel="yes"/>
         <xsl:param name="simpletable.props" required="yes" tunnel="yes"/>
         <xsl:param name="p5gnuplot:logscale.y1" required="yes" tunnel="yes"/>
         <xsl:param name="p5gnuplot:logscale.y2" required="yes" tunnel="yes"/>
         <xsl:param name="system_cache__dita:graph.separate.outputs.auto"/>
+        
         <xtics fileindex="{$fileindex}">
             <xsl:variable name="xtics">
                 <xtics>
@@ -161,7 +162,7 @@
                                                     </p5gnuplot:current-grouping-key.xtics>
                                                 </xsl:for-each>
                                                 <xsl:call-template name="system_cache__dita:graph.col__x3A__if_not_empty">
-                                                    <xsl:with-param name="xtics.pos" select="current()/@col"/>
+                                                    <xsl:with-param name="xtics.pos" select="$system_cache__dita:graph.ytics_detect_row"/><!-- TODO VAR --><!-- number(current())/@col+1 -->
                                                 </xsl:call-template>
                                                 
                                                 <xsl:value-of select="@current-grouping-key"/>
@@ -190,6 +191,8 @@
                         <xsl:with-param name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" select="$p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" tunnel="yes"/>
                         <xsl:with-param name="system_cache__dita:graph.lingstring__x3A__break.size" select="$system_cache__dita:graph.lingstring__x3A__break.size" tunnel="yes"/>
                         <xsl:with-param name="graph.data" select="$graph.data" tunnel="yes"/>
+                        <xsl:with-param name="graph.headers" select="$graph.headers" tunnel="yes"/>
+                        <xsl:with-param name="graph.title" select="$graph.title" tunnel="yes"/>
                         <xsl:with-param name="ytics" select="$ytics" tunnel="yes"/>
                         <xsl:with-param name="graph.newhistogram" select="$graph.newhistogram" tunnel="yes"/>
                         <xsl:with-param name="simpletable.props" select="$simpletable.props" tunnel="yes"/>
@@ -213,6 +216,8 @@
                 <xsl:with-param name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" select="$p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" tunnel="yes"/>
                 <xsl:with-param name="system_cache__dita:graph.lingstring__x3A__break.size" select="$system_cache__dita:graph.lingstring__x3A__break.size" tunnel="yes"/>
                 <xsl:with-param name="graph.data" select="$graph.data" tunnel="yes"/>
+                <xsl:with-param name="graph.headers" select="$graph.headers" tunnel="yes"/>
+                <xsl:with-param name="graph.title" select="$graph.title" tunnel="yes"/>
                 <xsl:with-param name="ytics" select="$ytics" tunnel="yes"/>
                 <xsl:with-param name="graph.newhistogram" select="$graph.newhistogram" tunnel="yes"/>
                 <xsl:with-param name="simpletable.props" select="$simpletable.props" tunnel="yes"/>
@@ -243,6 +248,8 @@
         <xsl:param name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" required="yes" tunnel="yes"/>
         <xsl:param name="system_cache__dita:graph.lingstring__x3A__break.size" required="yes" tunnel="yes"/>
         <xsl:param name="graph.data" required="yes" tunnel="yes"/>
+        <xsl:param name="graph.headers" required="yes"  tunnel="yes"/>
+        <xsl:param name="graph.title" required="yes" tunnel="yes"/>
         <xsl:param name="ytics" required="yes" tunnel="yes"/>
         <xsl:param name="graph.newhistogram" required="yes" tunnel="yes"/>
         <xsl:param name="simpletable.props" required="yes" tunnel="yes"/>
@@ -295,6 +302,8 @@
         <xsl:param name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" required="yes" tunnel="yes"/>
         <xsl:param name="system_cache__dita:graph.lingstring__x3A__break.size" required="yes" tunnel="yes"/> 
         <xsl:param name="graph.data" required="yes" tunnel="yes"/>
+        <xsl:param name="graph.headers" required="yes"  tunnel="yes"/>
+        <xsl:param name="graph.title" required="yes" tunnel="yes"/>
         <xsl:param name="ytics" required="yes" tunnel="yes"/>
         <xsl:param name="graph.newhistogram" required="yes" tunnel="yes"/>
         <xsl:param name="simpletable.props" required="yes" tunnel="yes"/>
@@ -354,7 +363,7 @@
                 <xsl:when test="preceding::graph.newhistogram"/>
                 <xsl:otherwise>
                     <xsl:choose>
-                        <xsl:when test="$system_cache__dita:graph.separate.outputs.auto">
+                        <xsl:when test="string-length($system_cache__dita:graph.separate.outputs.auto)&gt;0">
                             <xsl:call-template name="p5gnuplot:set.logscale.y2"/>
                             <xsl:call-template name="p5gnuplot:all_points_y2_value_undefined__x3A__detect"/>
                             <!--<xsl:call-template name="p5gnuplot:set.graph.output">
@@ -402,7 +411,7 @@
                 
                 <xsl:otherwise>
                     <xsl:choose>
-                        <xsl:when test="$system_cache__dita:graph.separate.outputs.auto">
+                        <xsl:when test="string-length($system_cache__dita:graph.separate.outputs.auto)&gt;0">
                             <!--<xsl:attribute name="debug">#324 due to $system_cache__dita:graph.separate.outputs.auto bypassed (,,,)</xsl:attribute>-->
                             <xsl:choose>
                                 <xsl:when test="preceding::graph.newhistogram">
@@ -444,6 +453,8 @@
         <xsl:param name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" required="yes" tunnel="yes"/>
         <xsl:param name="system_cache__dita:graph.lingstring__x3A__break.size" required="yes" tunnel="yes"/>
         <xsl:param name="graph.data" required="yes" tunnel="yes"/>
+        <xsl:param name="graph.headers" required="yes"  tunnel="yes"/>
+        <xsl:param name="graph.title" required="yes" tunnel="yes"/>
         <xsl:param name="ytics" required="yes" tunnel="yes"/>
         <xsl:param name="graph.newhistogram" required="yes" tunnel="yes"/>
         <xsl:param name="xtics.data.column__x3A__offset" select="p5gnuplot:xtics.data.column__x3A__offset()" tunnel="yes" />
@@ -472,6 +483,8 @@
         <xsl:param name="xtics.data.column__x3A__offset" select="p5gnuplot:xtics.data.column__x3A__offset()" tunnel="yes" />
         <xsl:param name="p5gnuplot:font__x3A__size" required="yes" tunnel="yes"/>
         <xsl:param name="graph.data" required="yes" tunnel="yes"/>
+        <xsl:param name="graph.headers" required="yes"  tunnel="yes"/>
+        <xsl:param name="graph.title" required="yes" tunnel="yes"/>
         <xsl:param name="ytics" required="yes" tunnel="yes"/>
         <xsl:param name="graph.newhistogram" required="yes" tunnel="yes"/>
         <xsl:param name="simpletable.props" required="yes" tunnel="yes"/>
@@ -503,8 +516,14 @@
                 </xsl:when>
             </xsl:choose>
             <xsl:call-template name="p5gnuplot:file.row.y"/>
-            <xsl:call-template name="p5gnuplot:file.row.platform"/>
-            <xsl:call-template name="p5gnuplot:file.row.props"/>
+            <system_cache__dita:graph.yaxis.platform>
+                <xsl:call-template name="system_cache__dita:graph.yaxis.platform">
+                    <xsl:with-param name="col" select="@col"/>
+                </xsl:call-template>    
+            </system_cache__dita:graph.yaxis.platform>
+            <xsl:call-template name="system_cache__dita:graph.yaxis.props">
+                <xsl:with-param name="col" select="@col"/>
+            </xsl:call-template>
             <!--<p5gnuplot:file.row.y  p5gnuplot:text="{number(@system_cache__dita:graph.ytics_detect_row)}" p5gnuplot:value="{@system_cache__dita:graph.ytics_detect_row}" debug="cond color columns"/>--><!-- $xtics.data.column__x3A__offset -->
             <xsl:choose>
                 <xsl:when test="number(@graph.color.variable) &gt;0">

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

@@ -130,7 +130,11 @@
     <xsl:template name="p5gnuplot:all_points_y2_value_undefined__x3A__detect">
         <p5gnuplot:all_points_y2_value_undefined__x3A__detect>
             <xsl:choose>
-                <xsl:when test="descendant-or-self::system_cache__dita:graph.col__x3A__if_not_empty[@system_cache__dita:graph.col__x3A__if_not_empty='1' and @graph.yaxis='x1y2']"/>
+                <xsl:when test="descendant-or-self::system_cache__dita:graph.col__x3A__if_not_empty[@system_cache__dita:graph.col__x3A__if_not_empty='1' and @graph.yaxis='x1y2']">
+                    <xsl:attribute name="debug">#135 A found axis: <xsl:for-each select="descendant-or-self::system_cache__dita:graph.col__x3A__if_not_empty[@system_cache__dita:graph.col__x3A__if_not_empty='1' and @graph.yaxis='x1y2']">
+                       <xsl:text> , </xsl:text> <xsl:value-of select="@graph.yaxis"/> col <xsl:value-of select="@xtics.pos"/>
+                    </xsl:for-each> </xsl:attribute>
+                </xsl:when>
                 <xsl:otherwise>
                     <xsl:attribute name="debug">#135 forcing set y2axis to disable</xsl:attribute>
                     <xsl:attribute name="p5gnuplot:text.join"><xsl:text>
@@ -164,6 +168,7 @@
         <xsl:param name="graph.headers"/>
         <xsl:param name="graph.title"/>
         <xsl:param name="graph.fill.style"/>
+        <xsl:param name="system_cache__dita:graph.stats"/>
         <xsl:choose>
             <xsl:when test="count($graph.headers//stentry) = count($graph.title//stentry)">
                 <xsl:message>#33-A [ V A L I D A T E ]  [ C O U N T ]  - [ OK ] (system_cache__dita:graph.axis__x3A__validate count($graph.headers//stentry) = count($graph.title//stentry))</xsl:message></xsl:when>
@@ -187,6 +192,23 @@
                 </xsl:message>
             </xsl:otherwise>
         </xsl:choose>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita:graph.stats//stentry">
+                <xsl:message>#33-D - [ V A L I D A T E ] TO DO stats p5gnuplot:simpletable__x3A__graph.stats </xsl:message>
+                <xsl:choose>
+                    <xsl:when test="count($graph.headers//stentry) = count($system_cache__dita:graph.stats//stentry)">
+                        <xsl:message>#33-D-OK - [ V A L I D A T E ] TO DO stats p5gnuplot:simpletable__x3A__graph.stats </xsl:message>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:message terminate="yes"> #33-D-ERROR - [ V A L I D A T E ] TO DO stats p5gnuplot:simpletable__x3A__graph.stats 
+                            @id = <xsl:value-of select="@id"/>
+                            c/$graph.headers = <xsl:value-of select="count($graph.headers//stentry)"/>
+                            c/$system_cache__dita:graph.stats = <xsl:value-of select="count($system_cache__dita:graph.stats//stentry)"/>
+                        </xsl:message>
+                    </xsl:otherwise>
+                </xsl:choose>
+            </xsl:when>
+        </xsl:choose>
     </xsl:template>
     
     
@@ -231,6 +253,10 @@
     </xsl:template>
     
     
+    <xsl:template name="system_cache__dita:graph.stats__x3A__detect">
+        <xsl:copy-of select="strow[ contains(@props,'graph.stats')]"/>
+    </xsl:template>
+    
     <xsl:template name="system_cache__dita:graph.fileindex__x3A__detect">
         <xsl:value-of select="@id"/>
     </xsl:template>
@@ -393,4 +419,39 @@ set xtics rotate
         </p5gnuplot:xtics.axis.list__x3A__detect>
     </xsl:template>-->
     
+    <xsl:function name="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
+        <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="col"/>
+        <xsl:variable name="out">
+            <xsl:call-template name="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
+                <xsl:with-param name="col" select="$col"/>
+                <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="system_cache__dita:graph.ytics_detect_row" select="$system_cache__dita:graph.ytics_detect_row"/>
+            </xsl:call-template>
+        </xsl:variable>
+        <xsl:choose>
+            <xsl:when test="$out//@system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram"><xsl:value-of select="true()"/></xsl:when>
+        </xsl:choose>
+    </xsl:function>
+    
+    <xsl:template name="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
+        <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="col"/>
+        <system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect>
+            <xsl:variable name="xtics.pos" select="system_cache__dita:graph.ytics_detect_row($system_cache__dita:graph.ytics_detect_row,$col)"/>
+            <xsl:attribute name="xtics.pos" select="$xtics.pos"/>
+            <xsl:choose>
+                <xsl:when test="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y//varname[@props='system_cache__dita:graph.ytics_detect_row' and text()=$xtics.pos]">
+                    <xsl:attribute name="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect" select="true()"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:attribute name="error">not in current axis @col = <xsl:value-of select="$col"/> </xsl:attribute>
+                </xsl:otherwise>
+            </xsl:choose>
+        </system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect>
+        
+    </xsl:template>
+    
 </xsl:stylesheet>

+ 42 - 4
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__fix.xsl

@@ -40,31 +40,69 @@
         </xsl:call-template>
     </xsl:template>
     
-    <xsl:template mode="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable" match="text()|comment()"/>
+    <xsl:template mode="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable" match="foreign|p5gnuplot:stats" priority="8">
+        <xsl:message>#44 matcehd <xsl:value-of select="name()"/></xsl:message>
+        <xsl:call-template name="system_cache__dita:graph.all.data.fit.fix__x3A__numerate">
+            <xsl:with-param name="strow" select="."/>
+        </xsl:call-template>
+        <!--<xsl:apply-templates mode="#current" select="text()"/>-->
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable" match="comment()"/>
+    
+    <xsl:template mode="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable" match="text()">
+        <!--<xsl:text></xsl:text>--><!--<xsl:copy-of select="."></xsl:copy-of>-->
+    </xsl:template>
     
     <xsl:template name="system_cache__dita:graph.all.data.fit.fix__x3A__numerate">
         <xsl:param name="strow" required="yes"/>
         <xsl:for-each select="$strow">
+            <!--<xsl:message>#50-TD name() = "<xsl:value-of select="name()"/>" - fixing it locall; */n = "<xsl:value-of select="*/name()"/>"; *//*/m = <xsl:value-of select="*//*/name()"/>;</xsl:message>-->
             <xsl:choose>
-                <xsl:when test="name()='strow' or name()='sthead'">
+                <xsl:when test="(name()='strow' or name()='sthead' )  "><!-- and not(.//*/name()='foreign') and not(.//*/name()='p5gnuplot:stats') -->
+                    <!--<xsl:message>#50-A name() = "<xsl:value-of select="name()"/>" - fixing it locall; */n = "<xsl:value-of select="*/name()"/>"; *//*/m = <xsl:value-of select="*//*/name()"/>;</xsl:message>-->
+                    <xsl:copy>
+                        <xsl:copy-of select="@*"/>
+                        <xsl:copy-of select="text()"/>
+                        <xsl:for-each select="*">
+                            <xsl:copy>
+                                <xsl:copy-of select="@*"/>
+                                <xsl:attribute name="col" select="position()"/>
+                                <xsl:copy-of select="text()"/>
+                                <xsl:apply-templates mode="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable"   />
+                            </xsl:copy>
+                        </xsl:for-each>
+                    </xsl:copy>
+                </xsl:when>
+                <xsl:when test="name()='p5gnuplot:stats' or  name()='foreign'  or  .//*/name()='foreign' or .//*/name()='p5gnuplot:stats' "><!-- name()='strow' or name()='sthead'  or   -->
+                    <!--<xsl:message>#50C name() = "<xsl:value-of select="name()"/>" - fixing it locall; */n = "<xsl:value-of select="*/name()"/>";</xsl:message>-->
                     <xsl:copy>
                         <xsl:copy-of select="@*"/>
+                        <xsl:copy-of select="text()"/>
                         <xsl:for-each select="*">
                             <xsl:copy>
                                 <xsl:copy-of select="@*"/>
                                 <xsl:attribute name="col" select="position()"/>
                                 <xsl:copy-of select="text()"/>
+                                <xsl:apply-templates mode="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable"   />
                             </xsl:copy>
                         </xsl:for-each>
                     </xsl:copy>
                 </xsl:when>
-                <xsl:when test="*/name()='strow' or */name()='sthead'">
+                <xsl:when test="(*/name()='strow' or */name()='sthead' ) and (not(*/name()='foreign')) and not(*/name()='p5gnuplot:stats')">
+                    <!--<xsl:message>#50-B-A name() = "<xsl:value-of select="name()"/>" - fixing it REMOTE; */n = "<xsl:value-of select="*/name()"/>";</xsl:message>-->
+                    <xsl:call-template name="system_cache__dita:graph.all.data.fit.fix__x3A__numerate">
+                        <xsl:with-param name="strow" select="*"/>
+                    </xsl:call-template>
+                </xsl:when>
+                <xsl:when test="*/name()='strow' or */name()='sthead' or */name()='foreign' or */name()='p5gnuplot:stats'">
+                    <!--<xsl:message>#50-B-B name() = "<xsl:value-of select="name()"/>" - fixing it REMOTE; [*/n = "<xsl:value-of select="*/name()"/>";] <xsl:copy-of select="*/@*"/>;;;</xsl:message>-->
                     <xsl:call-template name="system_cache__dita:graph.all.data.fit.fix__x3A__numerate">
                         <xsl:with-param name="strow" select="*"/>
                     </xsl:call-template>
                 </xsl:when>
                 <xsl:otherwise>
-                    <xsl:message terminate="yes">#165 INCORRECT FORMAT OF EXPECTED $strow/n=<xsl:value-of select="name()"/> , */n=<xsl:value-of select="*/name()"/> system_cache__dita:graph.all.data.fit.fix__x3A__numerate</xsl:message>
+                    <xsl:message terminate="yes">#165 INCORRECT FORMAT OF EXPECTED $strow/n=<xsl:value-of select="name()"/> , */n=<xsl:value-of select="*/name()"/>    *//*/m = <xsl:value-of select="*//*/name()"/>;  system_cache__dita:graph.all.data.fit.fix__x3A__numerate</xsl:message>
                 </xsl:otherwise>
             </xsl:choose>
         </xsl:for-each>

+ 67 - 8
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__set.xsl

@@ -5,6 +5,7 @@
     xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.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_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -17,19 +18,48 @@
     <xsl:template name="p5gnuplot:file.row.y">
         <p5gnuplot:file.row.y  p5gnuplot:text="{number(@system_cache__dita:graph.ytics_detect_row)}"
             p5gnuplot:value="{@system_cache__dita:graph.ytics_detect_row}" debug="cond color columns">
+            <xsl:attribute name="col" select="@col"/>
+            <xsl:attribute name="current-grouping-key" select="@current-grouping-key"/>
+            <xsl:attribute name="audience" select="@audience"/>
+            <xsl:attribute name="group" select="@group"/>
+            <xsl:attribute name="system_cache__dita:graph.ytics_detect_row" select="@system_cache__dita:graph.ytics_detect_row"/>
         </p5gnuplot:file.row.y>
     </xsl:template>
     
-    <xsl:template name="p5gnuplot:file.row.props">
-        <xsl:param name="xtics" required="yes" tunnel="yes"/>
-        <p5gnuplot:file.row.props>
-        </p5gnuplot:file.row.props>
+    
+    
+    <xsl:template name="system_cache__dita:graph.yaxis.props">
+        <xsl:param name="graph.headers" required="yes" tunnel="yes"/>
+        <xsl:param name="col" required="yes"/>
+        <system_cache__dita:graph.yaxis.props>
+            <xsl:choose>
+                <xsl:when test="$graph.headers//stentry[@col=$col]/text()">
+                    <xsl:attribute name="system_cache__dita:graph.yaxis.props" select="$graph.headers//stentry[@col=$col]/@props"/>
+                </xsl:when>
+                <xsl:otherwise><!-- TODO     -->
+                    <xsl:message terminate="no">#27-D error no $graph.headers//stentry[@col=$col]/text() = $col=<xsl:value-of select="$col"/> </xsl:message>
+                </xsl:otherwise>
+            </xsl:choose>
+        </system_cache__dita:graph.yaxis.props>
     </xsl:template>
     
-    <xsl:template name="p5gnuplot:file.row.platform">
-        <xsl:param name="xtics" required="yes" tunnel="yes"/>
-        <p5gnuplot:file.row.platform>
-        </p5gnuplot:file.row.platform>
+    <xsl:template name="system_cache__dita:graph.yaxis.platform">
+        <xsl:param name="graph.headers" required="yes" tunnel="yes"/>
+        <xsl:param name="col" required="yes"/>
+        <!--<system_cache__dita:graph.yaxis.platform>-->
+            <xsl:choose>
+                <xsl:when test="$graph.headers//stentry[@col=$col]/text()">
+                    <xsl:attribute name="system_cache__dita:graph.yaxis.platform" select="$graph.headers//stentry[@col=$col]/system_cache__dita:platform__x3A__unescape(@platform)"/>
+                    <!--<xsl:apply-templates select="$graph.headers//stentry[@col=$col]/@*" mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>-->
+                    <!--<xsl:if test="$graph.headers//stentry[@col=$col]/@platform">
+                        <xsl:attribute name="{system_cache__dita:platform__x3A__unescape($graph.headers//stentry[@col=$col]/@platform)}" select="$graph.headers//stentry[@col=$col]/@platform"/>
+                    </xsl:if>-->
+                </xsl:when>
+                <xsl:otherwise><!-- TODO     -->
+                    <xsl:message terminate="no">#27-E error no $graph.headers//stentry[@col=$col]/text() = $col=<xsl:value-of select="$col"/> </xsl:message>
+                </xsl:otherwise>
+            </xsl:choose>
+        <!--</system_cache__dita:graph.yaxis.platform>-->
     </xsl:template>
     
 <xsl:template name="p5gnuplot:set.xtics.rotate">
@@ -229,6 +259,23 @@ set output '</xsl:text><xsl:value-of select="$fileindex"/><xsl:text>.png'
     </xsl:template>
     
     
+    <xsl:template name="p5gnuplot:set.graph.group">
+        <xsl:param name="group__x3A__value"  required="yes"/>
+        <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:attribute name="group" select="concat($group__x3A__value,@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType])"/>
+            </xsl:when>
+        </xsl:choose>
+        
+    </xsl:template>
+    
+    
+    <xsl:function name="p5gnuplot:set.graph.stats.xml">
+        <xsl:param name="fileindex"/>
+        <xsl:value-of select="concat($ditadir,'/graph_to_image/',$fileindex,'.graph.stats.xml')"/>
+    </xsl:function>
     
     <xsl:function name="p5gnuplot:set.gnuplot.debug.xtics.xml">
         <xsl:param name="fileindex"/>
@@ -245,4 +292,16 @@ set output '</xsl:text><xsl:value-of select="$fileindex"/><xsl:text>.png'
         <xsl:value-of select="concat($ditadir,'/graph_to_image/',$fileindex,'.png')"/>
     </xsl:function>
     
+    <xsl:function name="p5gnuplot:set.graph.dat.row__x3A__from__ytics.xml">
+        <xsl:param name="fileindex"/>
+        <xsl:value-of select="concat($ditadir,'/graph_to_image/',$fileindex,'.graph.dat.row__x3A__from__ytics.xml')"/>
+    </xsl:function>
+    
+    
+    <xsl:function name="system_cache__dita:set.graph.ytics_detect_row.xml">
+        <xsl:param name="fileindex"/>
+        <xsl:value-of select="concat($ditadir,'/graph_to_image/',$fileindex,'.gnuplot.debug.graph.ytics_detect_row.xml')"/>
+    </xsl:function>
+    
+    
 </xsl:stylesheet>

+ 23 - 0
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.xaxis.xsl

@@ -5,6 +5,7 @@
     xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.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_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -32,6 +33,28 @@
     
     
     
+    
+    <xsl:template name="system_cache__dita:graph.xaxis.platform">
+        <xsl:param name="graph.title" required="yes" tunnel="yes"/>
+        <xsl:param name="col" required="yes"/>
+        <xsl:choose>
+            <xsl:when test="$graph.title//stentry[@col=$col]/text()">
+                <xsl:attribute name="system_cache__dita:graph.xaxis.platform" select="$graph.title//stentry[@col=$col]/system_cache__dita:platform__x3A__unescape(@platform)"/>
+                <xsl:if test="$graph.title//stentry[@col=$col]/@props">
+                    <xsl:attribute name="system_cache__dita:graph.xaxis.props" select="$graph.title//stentry[@col=$col]/@props"/>
+                </xsl:if>
+                <xsl:apply-templates select="$graph.title//stentry[@col=$col]/@*" mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>
+                <xsl:if test="$graph.title//stentry[@col=$col]/@platform">
+                    <xsl:attribute name="{system_cache__dita:platform__x3A__unescape($graph.title//stentry[@col=$col]/@platform)}" select="$graph.title//stentry[@col=$col]/text()"/>
+                </xsl:if>
+            </xsl:when>
+            <xsl:otherwise><!-- TODO     -->
+                <xsl:message terminate="no">#27-B error no $graph.headers//stentry[@col=$col]/text() = $col=<xsl:value-of select="$col"/> </xsl:message>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    
+    
     <xsl:template name="p5gnuplot:file.row.x.cluster.offset">
         <xsl:param name="fileindex" tunnel="yes" required="yes"/>
         <xsl:param name="graph.fill.style" required="yes" tunnel="yes"/>

+ 10 - 1
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.xsl

@@ -98,7 +98,7 @@
         <xsl:param name="graph.headers" required="yes"/>
         <xsl:param name="graph.data" required="yes"/>
         <xsl:param name="graph.color.variable" required="yes"/>
-        <xsl:param name="graph.title" required="yes"/>
+        <xsl:param name="graph.title" required="yes" />
         <xsl:param name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" required="yes"/>
         <xsl:param name="system_cache__dita:graph.lingstring__x3A__break.size" required="yes"/>
         <system_cache__dita:graph.dat.row__x3A__from__ytics.xml>
@@ -115,6 +115,10 @@
                     <xsl:choose>
                         <xsl:when test="position()=1 or 1=1">
                             <p5gnuplot:dat.sthead  p5gnuplot:text="{system_cache__dita:graph.lingstring__x3A__break(p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names(system_cache__dita:graph.yaxis.name($graph.title,@col)),$system_cache__dita:graph.lingstring__x3A__break.size)}" p5gnuplot:value="{system_cache__dita:graph.yaxis.name($graph.title,@col)}">
+                                <xsl:call-template name="system_cache__dita:graph.yaxis.platform">
+                                    <xsl:with-param name="col" select="@col"/>
+                                    <xsl:with-param name="graph.headers" select="$graph.headers" tunnel="yes"/>
+                                </xsl:call-template>
                                 <xsl:attribute name="p5gnuplot:text.join"><xsl:text>&#09;</xsl:text></xsl:attribute>
                             </p5gnuplot:dat.sthead>
                         </xsl:when>
@@ -144,6 +148,11 @@
                             <xsl:attribute name="p5gnuplot:text" select="system_cache__dita:graph.lingstring__x3A__break(p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names(system_cache__dita:graph.xaxis($graph.headers,@col),$p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size),$system_cache__dita:graph.lingstring__x3A__break.size)"/>
                             <xsl:attribute name="p5gnuplot:value" select="system_cache__dita:graph.xaxis($graph.headers,@col)"/>
                             <xsl:attribute name="p5gnuplot:text.join"><xsl:text>&#09;</xsl:text></xsl:attribute>
+                            <!--<xsl:attribute name="platform" select="system_cache__dita:graph.xaxis.platform($graph.headers,@col)"/>-->
+                            <xsl:call-template name="system_cache__dita:graph.xaxis.platform">
+                                <xsl:with-param name="col" select="@col"/>
+                                <xsl:with-param name="graph.title" select="$graph.title" tunnel="yes"/>
+                            </xsl:call-template>
                         </p5gnuplot:dat.sthead.ytics.row>
                     </xsl:if>
                 </xsl:for-each>

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

@@ -130,10 +130,15 @@
             <xsl:call-template name="system_cache__dita:graph.strow__x3A__detect"/>
         </xsl:variable>
         
+        <xsl:variable name="system_cache__dita:graph.stats">
+            <xsl:call-template name="system_cache__dita:graph.stats__x3A__detect"/>
+        </xsl:variable>
+        
         <xsl:call-template name="system_cache__dita:graph.axis__x3A__validate">
             <xsl:with-param name="graph.headers" select="$graph.headers"/>
             <xsl:with-param name="graph.title" select="$graph.title"/>
             <xsl:with-param name="graph.fill.style" select="$graph.fill.style"/>
+            <xsl:with-param name="system_cache__dita:graph.stats" select="$system_cache__dita:graph.stats"/>
         </xsl:call-template>
         
         <!--<xsl:apply-templates mode="system_cache__dita:graph__write" select=".">
@@ -157,6 +162,8 @@
             </xsl:call-template>
         </xsl:variable>
         
+        
+        
         <xsl:variable name="xtics">
             <xsl:call-template name="system_cache__dita:graph.xtics">
                 <xsl:with-param name="system_cache__dita:graph.title" select="$system_cache__dita:graph.title"/>
@@ -170,14 +177,15 @@
                 <xsl:with-param name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" select="$p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size"/>
                 <xsl:with-param name="system_cache__dita:graph.lingstring__x3A__break.size" select="$system_cache__dita:graph.lingstring__x3A__break.size"/>
                 <xsl:with-param name="graph.data" select="$graph.data" tunnel="yes"/>
-                <xsl:with-param name="graph.headers" select="$graph.headers"/>
-                <xsl:with-param name="graph.title" select="$graph.title"/>
+                <xsl:with-param name="graph.headers" select="$graph.headers" tunnel="yes"/>
+                <xsl:with-param name="graph.title" select="$graph.title" tunnel="yes"/>
                 <xsl:with-param name="ytics" select="$ytics" tunnel="yes"/>
                 <xsl:with-param name="system_cache__dita:graph.ytics_detect_row" select="$system_cache__dita:graph.ytics_detect_row" tunnel="yes"/>
                 <xsl:with-param name="simpletable.props" select="@props" tunnel="yes"/>
                 <xsl:with-param name="p5gnuplot:logscale.y1" select="$p5gnuplot:logscale.y1" tunnel="yes"/>
                 <xsl:with-param name="p5gnuplot:logscale.y2" select="$p5gnuplot:logscale.y2" tunnel="yes"/>
                 <xsl:with-param name="system_cache__dita:graph.separate.outputs.auto" select="$system_cache__dita:graph.separate.outputs.auto"/>
+                
             </xsl:call-template>
         </xsl:variable>
         
@@ -194,7 +202,7 @@
                 <xsl:with-param name="graph.headers" select="$graph.headers"/>
                 <xsl:with-param name="graph.data" select="$graph.data"/>
                 <xsl:with-param name="graph.color.variable" select="$graph.color.variable"/>
-                <xsl:with-param name="graph.title" select="$graph.title"/>
+                <xsl:with-param name="graph.title" select="$graph.title" />
                 <xsl:with-param name="p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size" select="$p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names.size"/>
                 <xsl:with-param name="system_cache__dita:graph.lingstring__x3A__break.size" select="$system_cache__dita:graph.lingstring__x3A__break.size"/>
                 
@@ -232,6 +240,7 @@
                     <xsl:with-param name="strow" select="$strow"/>
                     <xsl:with-param name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml" select="$system_cache__dita:graph.dat.row__x3A__from__ytics.xml"/>
                     <xsl:with-param name="system_cache__dita:graph.separate.outputs.auto" select="$system_cache__dita:graph.separate.outputs.auto"/>
+                    <xsl:with-param name="system_cache__dita:graph.stats" select="$system_cache__dita:graph.stats"/>
                 </xsl:call-template>
             </xsl:when>
             <xsl:when test="$system_cache__dita:graph__x3A__variables__x3A__init__x3A__call='p5gnuplot:simpletable__x3A__from_rows'">

+ 2 - 2
SE/schema/default_db_xml_cache.public/default_db/system_cache__dita__x3A__to_merge/tree_to_dita__x3A__platform.xsl

@@ -18,12 +18,12 @@
     
     <xsl:function name="system_cache__dita:platform__x3A__escape">
         <xsl:param name="text"/>
-        <xsl:value-of select="replace(replace($text,' ','_x32_'),':','_x3A_')"/>
+        <xsl:value-of select="replace(replace($text,' ','_x32_'),':','_@x3A_')"/>
     </xsl:function>
     
     <xsl:function name="system_cache__dita:platform__x3A__unescape">
         <xsl:param name="text"/>
-        <xsl:value-of select="replace(replace($text,'_x32_',' '),'_x3A_',':')"/>
+        <xsl:value-of select="replace(replace($text,'_x32_',' '),'_@x3A_',':')"/>
     </xsl:function>
     
     

+ 10 - 0
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.element.xsl

@@ -13,8 +13,18 @@
         <xsl:choose>
             <xsl:when test="$system_cache__dita:element='ol'"><xsl:value-of select="'li'"/></xsl:when>
             <xsl:when test="$system_cache__dita:element='lq'"><xsl:value-of select="'p'"/></xsl:when>
+            <xsl:when test="$system_cache__dita:element='p'"><xsl:value-of select="'lq'"/></xsl:when>
+            <xsl:when test="$system_cache__dita:element='equation-inline'"><xsl:value-of select="'equation-inline'"/></xsl:when>
+            <xsl:when test="$system_cache__dita:element='dl'"><xsl:value-of select="'dd'"/></xsl:when>
+            
             <xsl:otherwise><xsl:message terminate="yes">#16 TODO undefined next element for <xsl:value-of select="$system_cache__dita:element"/></xsl:message></xsl:otherwise>
         </xsl:choose>
     </xsl:function>
     
+    
+    <xsl:function name="system_cache__dita:element__x3A__parent">
+        <xsl:param name="system_cache__dita:element__x3A__parent"/>
+        <xsl:value-of select="system_cache__dita:element.next($system_cache__dita:element__x3A__parent)"/>
+    </xsl:function>
+    
 </xsl:stylesheet>

+ 19 - 4
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.localname.translate.xsl

@@ -111,20 +111,35 @@
     
     
     
-    <xsl:template mode="system_cache__dita:localname.translate" match="@default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter|@platform[contains(system_cache__dita:platform__x3A__unescape(.),'default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter')]|@platform[contains(.,'default_db__x3A__BI_audit_BENFORD_x3A_leadingTimeYear-quarter')]" >
+    <xsl:template mode="system_cache__dita:localname.translate" match="@default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter|
+        @platform[contains(system_cache__dita:platform__x3A__unescape(.),'default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter')]|
+        @platform[contains(.,'default_db__x3A__BI_audit_BENFORD_x3A_leadingTimeYear-quarter')]|
+        @system_cache__dita:graph.xaxis.platform[contains(system_cache__dita:platform__x3A__unescape(.),'default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter')]|
+        @system_cache__dita:graph.xaxis.platform[contains(.,'default_db__x3A__BI_audit_BENFORD_@x3A_leadingTimeYear-quarter')]|
+        @system_cache__dita:graph.yaxis.platform[contains(system_cache__dita:platform__x3A__unescape(.),'default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter')]|
+        @system_cache__dita:graph.yaxis.platform[contains(.,'default_db__x3A__BI_audit_BENFORD_@x3A_leadingTimeYear-quarter')]" >
         <xsl:text>rok|kwartał</xsl:text>
     </xsl:template>
     
-    <xsl:template mode="system_cache__dita:localname.translate" match="@default_db__x3A__BI_audit_BENFORD:leadingNumber|@platform[contains(system_cache__dita:platform__x3A__unescape(.),'default_db__x3A__BI_audit_BENFORD:leadingNumber')]|@platform[contains(.,'default_db__x3A__BI_audit_BENFORD_x3A_leadingNumber')]" >
+    <xsl:template mode="system_cache__dita:localname.translate" match="@default_db__x3A__BI_audit_BENFORD:leadingNumber|
+        @platform[contains(system_cache__dita:platform__x3A__unescape(.),'default_db__x3A__BI_audit_BENFORD:leadingNumber')]|
+        @platform[contains(.,'default_db__x3A__BI_audit_BENFORD_x3A_leadingNumber')]|
+        @system_cache__dita:graph.xaxis.platform[contains(system_cache__dita:platform__x3A__unescape(.),'default_db__x3A__BI_audit_BENFORD:leadingNumber')]|
+        @system_cache__dita:graph.xaxis.platform[contains(.,'default_db__x3A__BI_audit_BENFORD_@x3A_leadingNumber')]|
+        @system_cache__dita:graph.yaxis.platform[contains(system_cache__dita:platform__x3A__unescape(.),'default_db__x3A__BI_audit_BENFORD:leadingNumber')]|
+        @system_cache__dita:graph.yaxis.platform[contains(.,'default_db__x3A__BI_audit_BENFORD_@x3A_leadingNumber')]
+        " >
         <xsl:text>liczba Benford</xsl:text>
     </xsl:template>
     
     
-    <xsl:template mode="system_cache__dita:localname.translate" match="@props[contains(.,'sum')]" >
+    
+    
+    <xsl:template mode="system_cache__dita:localname.translate" match="@props[contains(.,'sum')]|@system_cache__dita:graph.xaxis.props[contains(.,'sum')]" >
         <xsl:text>suma</xsl:text>
     </xsl:template>
     
-    <xsl:template mode="system_cache__dita:localname.translate" match="@props[contains(.,'count')]" >
+    <xsl:template mode="system_cache__dita:localname.translate" match="@props[contains(.,'count')]|@system_cache__dita:graph.xaxis.props[contains(.,'count')]" >
         <xsl:text>ilość</xsl:text>
     </xsl:template>
     

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

@@ -30,5 +30,6 @@
     <xsl:include href="system_cache__dita__x3A__to_merge/tree_to_dita__x3A__transform_by_values_map.xsl"/>
     <!--<xsl:include href="../../WPS_Functions/render-vis-js-in-electron-\-v0.0.1/p5.nodeCoords__x3A__tree_to_dita.xsl"/>-->
     
+    <xsl:include href="Linear_regression/Linear_regression.xsl"/>
     
 </xsl:stylesheet>

+ 12 - 12
se.oxygen.xpr

@@ -18,7 +18,7 @@
                         <scenarioAssociation-array>
                             <scenarioAssociation>
                                 <field name="url">
-                                    <String>../../procesy5-dita-templates-druki/PROJEKTY/6768.Grozby_Karalne_rafal_zol_2017_06/6768.grozby_karalne_rafal_zol_2017_06.reltable.ditamap</String>
+                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-136_000006_/relations-136_000006_.ditamap</String>
                                 </field>
                                 <field name="scenarioIds">
                                     <list>
@@ -33,7 +33,7 @@
                             </scenarioAssociation>
                             <scenarioAssociation>
                                 <field name="url">
-                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-164_000001/relations-164_000001.ditamap</String>
+                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/BI_audit_BENFORD_24/BI_audit_BENFORD_24.ditamap</String>
                                 </field>
                                 <field name="scenarioIds">
                                     <list>
@@ -48,7 +48,7 @@
                             </scenarioAssociation>
                             <scenarioAssociation>
                                 <field name="url">
-                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-136_000006_/relations-136_000006_.ditamap</String>
+                                    <String>../../procesy5-dita-templates-druki/6872-bocian-energa-oferta-system-req.git/raport.powiazan/bocian_raport_powi_za.ditamap</String>
                                 </field>
                                 <field name="scenarioIds">
                                     <list>
@@ -63,7 +63,7 @@
                             </scenarioAssociation>
                             <scenarioAssociation>
                                 <field name="url">
-                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-136_000006_/graph_to_image/BI_audit_ENERGA_PRACOWNICY_APU4_umowy_APU4-DPW_BI_audit_ENERGA_PRACOWNICY.432.gnuplot.dita</String>
+                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-164_000001/relations-164_000001.ditamap</String>
                                 </field>
                                 <field name="scenarioIds">
                                     <list>
@@ -78,7 +78,7 @@
                             </scenarioAssociation>
                             <scenarioAssociation>
                                 <field name="url">
-                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-136_000004/relations-136_000004.ditamap</String>
+                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-136_000006_/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row.410252____APT_trasy.dita</String>
                                 </field>
                                 <field name="scenarioIds">
                                     <list>
@@ -93,7 +93,7 @@
                             </scenarioAssociation>
                             <scenarioAssociation>
                                 <field name="url">
-                                    <String>../../procesy5-dita-templates-druki/6872-bocian-energa-oferta-system-req.git/raport.powiazan/bocian_raport_powi_za.ditamap</String>
+                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-136_000006_/graph_to_image/BI_audit_ENERGA_PRACOWNICY_APU4_umowy_APU4-DPW_BI_audit_ENERGA_PRACOWNICY.432.gnuplot.dita</String>
                                 </field>
                                 <field name="scenarioIds">
                                     <list>
@@ -108,31 +108,31 @@
                             </scenarioAssociation>
                             <scenarioAssociation>
                                 <field name="url">
-                                    <String>SE/schema/WPS_Functions/render-vis-js-in-electron--v0.0.1/p5.nodeCoords__x3A__tree_to_dita.xsl</String>
+                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-136_000004/relations-136_000004.ditamap</String>
                                 </field>
                                 <field name="scenarioIds">
                                     <list>
-                                        <String>p5 babbelki</String>
+                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
                                     </list>
                                 </field>
                                 <field name="scenarioTypes">
                                     <list>
-                                        <String>XML</String>
+                                        <String>DITAMAP</String>
                                     </list>
                                 </field>
                             </scenarioAssociation>
                             <scenarioAssociation>
                                 <field name="url">
-                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/BI_audit_BENFORD_24/BI_audit_BENFORD_24.ditamap</String>
+                                    <String>SE/schema/WPS_Functions/render-vis-js-in-electron--v0.0.1/p5.nodeCoords__x3A__tree_to_dita.xsl</String>
                                 </field>
                                 <field name="scenarioIds">
                                     <list>
-                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
+                                        <String>p5 babbelki</String>
                                     </list>
                                 </field>
                                 <field name="scenarioTypes">
                                     <list>
-                                        <String>DITAMAP</String>
+                                        <String>XML</String>
                                     </list>
                                 </field>
                             </scenarioAssociation>