Browse Source

upd todo checjk grafy

a.binder 5 năm trước cách đây
mục cha
commit
4569a961f1
31 tập tin đã thay đổi với 3388 bổ sung764 xóa
  1. 715 17
      SE/schema/WPS_Functions/SvgCharts4Xsl/barchart.xsl
  2. 49 17
      SE/schema/WPS_Functions/SvgCharts4Xsl/charts.xsl
  3. 165 2
      SE/schema/WPS_Functions/SvgCharts4Xsl/common.xsl
  4. 34 1
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_BENFORD/default_db__x3A__BI_audit_BENFORD.BI_audit_BENFORD.xsl
  5. 15 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
  6. 81 2
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.xsl
  7. 380 277
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.graph.deals.xsl
  8. 278 94
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.graph.related.xsl
  9. 11 6
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl
  10. 13 2
      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
  11. 7 7
      SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_operational_raport_note.xsl
  12. 7 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.sources.xsl
  13. 32 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.xsl
  14. 29 4
      SE/schema/default_db_xml_cache.public/default_db/dateTime.xsl
  15. 231 21
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl
  16. 176 66
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats.xsl
  17. 168 66
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl
  18. 6 5
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl
  19. 17 4
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics.xsl
  20. 13 4
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__detect.xsl
  21. 1 1
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__fix.xsl
  22. 2 1
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__plot.xsl
  23. 19 2
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__set.xsl
  24. 6 0
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.xsl
  25. 17 8
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.yaxis.standalone.xsl
  26. 9 0
      SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat__x3A__init.xsl
  27. 784 137
      SE/schema/default_db_xml_cache.public/default_db/system_cache__dita__x3A__p5gnuplot/system_cache__dita__x3A__p5gnuplot.interface.xsl
  28. 8 1
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.localname.translate.xsl
  29. 2 0
      SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.xsl
  30. 1 1
      SE/schema/default_db_xml_cache/build_complexType.xsl
  31. 112 16
      se.oxygen.xpr

+ 715 - 17
SE/schema/WPS_Functions/SvgCharts4Xsl/barchart.xsl

@@ -16,14 +16,712 @@ Redistribution and use, with or without modification, are permitted provided tha
     # Neither the name of Imaginea nor the names of the developers may be used to endorse or promote products derived from
       this software without specific prior written permission.
 -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="2.0"
+	xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+	xmlns:svg="http://www.w3.org/2000/svg"
+	xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 	<xsl:import href="common.xsl" />
-
+	<xsl:import href="../../default_db_xml_cache.public/default_db/dateTime.xsl"/>
 	<!-- Constants -->
 	<xsl:variable name="MIN_VERTICAL_SPAN" select="75" />
 
+
+
+
+	<xsl:template name="p5gnuplot:SvgCharts4Xsl" >
+		<!--<xsl:param name="xData" />-->
+		<xsl:param name="xData.name" />
+		<xsl:param name="xData.postition"/>
+		<xsl:param name="yData" />
+		<xsl:param name="y2Data" />
+		<xsl:param name="yData.attr" />
+		<xsl:param name="yData.attr.title"/>
+		<xsl:param name="y2Data.attr" />
+		<xsl:param name="y2Data.attr.title"/>
+		<xsl:param name="width" select="'50%'" />
+		<xsl:param name="height" select="'50%'" />
+		<xsl:param name="viewBoxWidth" select="300" />
+		<xsl:param name="viewBoxHeight" select="300" />
+		<xsl:param name="barWidth" select="30" />
+		<xsl:param name="leftPadding" select="50" />
+		<xsl:param name="rightPadding" select="10" />
+		<xsl:param name="topPadding" select="25" />
+		<xsl:param name="verticalSpan" select="100" />
+		
+		<!--<xsl:variable name="xCount" select="count($xData)" />-->
+			<xsl:variable name="xData.name.Count" select="count($xData.name)" />
+			<xsl:variable name="xData.postition.Count" select="count($xData.postition)" />
+		<xsl:variable name="yCount"  >
+			<xsl:choose>
+				<xsl:when test="$yData">
+					<xsl:value-of select="count($yData)"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="count($yData.attr)"/>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		<xsl:variable name="y2Count"  >
+			<xsl:choose>
+				<xsl:when test="$y2Data">
+					<xsl:value-of select="count($y2Data)"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="count($y2Data.attr)"/>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		
+		<xsl:variable name="yAllCount" select="(($yCount+$y2Count) div 2)" />
+		
+		
+		<xsl:variable name="Data.analyzed"  >
+			<Data.analyzed>
+				<xsl:for-each select="$xData.name">
+					<xData.name pos="{position()}">
+						<xsl:value-of select="text()"/>
+					</xData.name>
+				</xsl:for-each>
+				<xsl:for-each select="$xData.postition">
+					<xData.postition pos="{position()}">
+						<xsl:choose>
+							<xsl:when test="min($xData.postition) = number(.)">
+								<xsl:attribute name="min" select="number(.)"/>
+								<xsl:attribute name="minX" select="number(.)"/>
+							</xsl:when>
+						</xsl:choose>
+						<xsl:choose>
+							<xsl:when test="max($xData.postition) = number(.)">
+								<xsl:attribute name="min" select="number(.)"/>
+								<xsl:attribute name="maxX" select="number(.)"/>
+							</xsl:when>
+						</xsl:choose>
+						<xsl:value-of select="."/>
+					</xData.postition>
+				</xsl:for-each>
+				
+				
+				<xsl:choose>
+					<xsl:when test="$yData">
+						<xsl:for-each select="$yData">
+							<yData.postition pos="{position()}">
+								<xsl:choose>
+									<xsl:when test="min($yData/number(.)) = number(.)">
+										<xsl:attribute name="min" select="number(.)"/>
+										<xsl:choose>
+											<xsl:when test="number(.) &lt;=min($y2Data/number(.))">
+												<xsl:attribute name="minY" select="number(.)"/>
+											</xsl:when>
+										</xsl:choose>
+									</xsl:when>
+								</xsl:choose>
+								<xsl:choose>
+									<xsl:when test="max($yData/number(text())) = number(.)">
+										<xsl:attribute name="max" select="number(.)"/>
+										<xsl:choose>
+											<xsl:when test="number(current()) &gt;= max($y2Data/number(text()))">
+												<xsl:attribute name="maxY" select="number(.)"/>
+											</xsl:when>
+										</xsl:choose>
+									</xsl:when>
+								</xsl:choose>
+								
+								<xsl:value-of select="."/>
+							</yData.postition>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="$yData.attr">
+						
+						<xsl:for-each select="$yData.attr">
+							<yData.postition pos="{position()}"    >
+								<xsl:attribute name="leadingTimeDate.int" select="replace(.,'-','')"/>
+								<xsl:attribute name="system_cache__dita:year-timestamp-day" select="system_cache__dita:year-timestamp-day(.)"/>
+								<xsl:attribute name="system_cache__dita:year-quarter" select="system_cache__dita:year-quarter(.)"/>
+								<xsl:if test="$yData.attr.title[ position()=current()/position()]">
+									<xsl:attribute name="yData.attr.title" select="$yData.attr.title[position()=current()/position()]/text()"/>
+									<xsl:attribute name="yData.attr.title_ALL">
+										<xsl:copy-of select="$yData.attr.title"></xsl:copy-of>
+									</xsl:attribute>
+								</xsl:if>
+								<xsl:choose>
+									<xsl:when test="min($yData.attr/number(replace(.,'-',''))) = number(replace(.,'-',''))">
+										<xsl:attribute name="min" select="number(replace(.,'-',''))"/>
+										<xsl:choose>
+											<xsl:when test="number(replace(.,'-','')) &lt;= min($y2Data.attr/number(replace(.,'-','')))">
+												<xsl:attribute name="minY" select="number(replace(.,'-',''))"/>
+											</xsl:when>
+										</xsl:choose>
+									</xsl:when>
+								</xsl:choose>
+								<xsl:choose>
+									<xsl:when test="max($yData.attr/number(replace(.,'-',''))) = number(replace(.,'-',''))">
+										<xsl:attribute name="max" select="number(replace(.,'-',''))"/>
+										<xsl:choose>
+											<xsl:when test="number(replace(.,'-','')) &gt;= max($y2Data.attr/number(replace(.,'-','')))">
+												<xsl:attribute name="maxY" select="number(replace(.,'-',''))"/>
+											</xsl:when>
+										</xsl:choose>
+									</xsl:when>
+								</xsl:choose>
+								
+								<xsl:value-of select="replace(.,'-','')"/>
+							</yData.postition>
+						</xsl:for-each>
+					</xsl:when>
+				</xsl:choose>
+				
+				<xsl:choose>
+					<xsl:when test="$y2Data">
+						<xsl:for-each select="$y2Data">
+							<y2Data.postition pos="{position()}">
+								<xsl:choose>
+									<xsl:when test="min($y2Data/number(text())) = number(.)">
+										<xsl:attribute name="min" select="number(.)"/>
+									<xsl:choose>
+										<xsl:when test="number(current()) &lt;=min($yData/number(text()))">
+											<xsl:attribute name="minY" select="number(.)"/>
+										</xsl:when>
+									</xsl:choose>
+								</xsl:when>
+								</xsl:choose>
+								<xsl:choose>
+									<xsl:when test="max($y2Data/number(text())) = number(.)">
+										<xsl:attribute name="max" select="number(.)"/>
+										<xsl:choose>
+											<xsl:when test="number(current()) &gt;=max($yData/number(text()))">
+												<xsl:attribute name="maxY" select="number(.)"/>
+											</xsl:when>
+										</xsl:choose>
+									</xsl:when>
+								</xsl:choose>
+								<xsl:value-of select="."/>
+							</y2Data.postition>
+						</xsl:for-each>
+					</xsl:when>
+					<xsl:when test="$y2Data.attr">
+						<xsl:for-each select="$y2Data.attr">
+							<y2Data.postition pos="{position()}" deb_max="{number(replace(.,'-',''))}" deb_max2="{max($yData.attr/number(replace(.,'-','')))}">
+								
+								<xsl:attribute name="leadingTimeDate.int" select="replace(.,'-','')"/>
+								<xsl:attribute name="system_cache__dita:year-timestamp-day" select="system_cache__dita:year-timestamp-day(.)"/>
+								<xsl:if test="$y2Data.attr.title[ position()=current()/position()]">
+									<xsl:attribute name="y2Data.attr.title" select="$y2Data.attr.title[ position()=current()/position()]"/>
+								</xsl:if>
+								<xsl:choose>
+									<xsl:when test="min($y2Data.attr/number(replace(.,'-',''))) = number(replace(.,'-',''))">
+										<xsl:attribute name="min" select="number(replace(.,'-',''))"/>
+										<xsl:choose>
+											<xsl:when test="number(.) &lt;=min($yData.attr/number(.))">
+												<xsl:attribute name="minY" select="number(replace(.,'-',''))"/>
+											</xsl:when>
+										</xsl:choose>
+									</xsl:when>
+								</xsl:choose>
+								<xsl:choose>
+									<xsl:when test="max($y2Data.attr/number(replace(.,'-',''))) = number(replace(.,'-',''))">
+										<xsl:attribute name="max" select="number(replace(.,'-',''))"/>
+										<xsl:choose>
+											<xsl:when test="number(replace(.,'-','')) &gt;= max($yData.attr/number(replace(.,'-','')))">
+												<xsl:attribute name="maxY" select="number(replace(.,'-',''))"/>
+											</xsl:when>
+										</xsl:choose>
+									</xsl:when>
+								</xsl:choose>
+								<xsl:value-of select="replace(.,'-','')"/>
+							</y2Data.postition>
+						</xsl:for-each>
+					</xsl:when>
+				</xsl:choose>
+			</Data.analyzed>
+		</xsl:variable>
+		
+		<xsl:copy-of select="$Data.analyzed"></xsl:copy-of>
+		<!--<xsl:comment>199 
+			$xData.postition = <xsl:value-of select="$xData.postition"/>
+			
+			<xsl:for-each select="$Data.analyzed/descendant-or-self::*">
+				name()=<xsl:value-of select="name()"/>
+						<xsl:for-each select="@*">
+							@<xsl:value-of select="name()"/>=<xsl:value-of select="."/><xsl:text> , </xsl:text>
+						</xsl:for-each>
+			</xsl:for-each>
+			
+			</xsl:comment>-->
+		
+		<xsl:variable name="_verticalSpan">
+			<xsl:choose>
+				<xsl:when test="$verticalSpan &lt; $MIN_VERTICAL_SPAN">
+					<xsl:value-of select="$MIN_VERTICAL_SPAN" />
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="$verticalSpan" />
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:variable>
+		
+		<svg:svg version="1.1" width="{$width}" height="{$height}" preserveAspectRatio="xMinYMin" viewBox="0 0 {$viewBoxWidth} {$viewBoxHeight}"
+			xmlns:svg="http://www.w3.org/2000/svg">
+			
+			<!--<xsl:variable name="test.max">
+				<xsl:choose>
+					<xsl:when test="max($Data.analyzed//yData.postition/number()) &gt; 0 and
+						max($Data.analyzed//yData.postition/number()) &gt; 0
+						">1</xsl:when>
+					<xsl:otherwise>0</xsl:otherwise>
+				</xsl:choose>
+			</xsl:variable>-->
+			
+			
+			<!--<xsl:variable name="y2DataMin">
+						<xsl:call-template name="minimum">
+							<xsl:with-param name="numbers" select="$y2Data" />
+						</xsl:call-template>
+					</xsl:variable>-->
+			
+			
+			
+			
+			
+			<xsl:choose>				
+				<xsl:when test="1=1"><!--$yData $xData.postition --><!-- max($Data.analyzed//yData.postition/number(@pos)) &gt; 0 and
+					max($Data.analyzed//y2Data.postition/number(@pos)) &gt; 0
+					 -->
+					<xsl:variable name="yDataMin" >
+						<xsl:for-each select="$Data.analyzed//yData.postition/@min">
+							<xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
+						</xsl:for-each>
+						
+					</xsl:variable>
+					
+					<xsl:variable name="yAllDataMin" >
+						<xsl:for-each select="$Data.analyzed//@minY">
+							<xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
+						</xsl:for-each>
+						
+					</xsl:variable>
+					
+					<xsl:variable name="y2DataMin" >
+						<xsl:for-each select="$Data.analyzed//y2Data.postition/@min">
+							<xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
+						</xsl:for-each>
+						
+					</xsl:variable>
+					
+					<xsl:variable name="yDataMax" >
+						<xsl:for-each select="$Data.analyzed//yData.postition/@max">
+							<xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:variable name="yAllDataMax" >
+						<xsl:for-each select="$Data.analyzed//@maxY">
+							<xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
+						</xsl:for-each>
+					</xsl:variable>
+					<xsl:variable name="y2DataMax" >
+						<xsl:for-each select="$Data.analyzed//y2Data.postition/@max">
+							<xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
+						</xsl:for-each>
+						
+					</xsl:variable>
+					
+					<xsl:variable name="yScale"	select="$_verticalSpan div ($yDataMax - $yDataMin)" />
+					<xsl:variable name="y2Scale"	select="$_verticalSpan div ($y2DataMax - $y2DataMin)" />
+					<xsl:variable name="yAllScale"	select="$_verticalSpan div ($yAllDataMax - $yAllDataMin)" />
+					<xsl:variable name="yDelta"	select="round(($yDataMax - $yDataMin) div $yCount)*2" />
+					<xsl:variable name="y2Delta"	select="round(($y2DataMax - $y2DataMin) div $y2Count)*2" />
+					<xsl:variable name="yAllDelta"	select="round(($yAllDataMax - $yAllDataMin) div $yAllCount)*2" />
+					<xsl:variable name="xMin" select="$leftPadding" />
+					<xsl:variable name="xMax" select="$xMin+count($yData)*$barWidth+$rightPadding" />
+					<xsl:variable name="yMin">
+						<xsl:choose>
+							<xsl:when test="$yDataMin &lt; 0">
+								<xsl:value-of select="$yDataMin - $yDelta" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="0" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="y2Min">
+						<xsl:choose>
+							<xsl:when test="$y2DataMin &lt; 0">
+								<xsl:value-of select="$y2DataMin - $y2Delta" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="0" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					
+					<xsl:variable name="yAllMin">
+						<xsl:choose>
+							<xsl:when test="$yAllDataMin &lt; 0">
+								<xsl:value-of select="$yAllDataMin - $yAllDelta" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="0" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					
+					<xsl:variable name="yMax" select="$yDataMax+$yDelta" />
+					<xsl:variable name="y2Max" select="$y2DataMax+$y2Delta" />
+					<xsl:variable name="yAllMax" select="$yAllDataMax+$yAllDelta" />
+					<xsl:variable name="bottom">
+						<xsl:choose>
+							<xsl:when test="$yDataMin &lt; 0">
+								<xsl:value-of select="- $_verticalSpan" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="0" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="bottom2">
+						<xsl:choose>
+							<xsl:when test="$y2DataMin &lt; 0">
+								<xsl:value-of select="- $_verticalSpan" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="0" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="bottomAll">
+						<xsl:choose>
+							<xsl:when test="$yAllDataMin &lt; 0">
+								<xsl:value-of select="- $_verticalSpan" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="0" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="yStep" select="$yDelta*$yScale" />
+					<xsl:variable name="y2Step" select="$y2Delta*$y2Scale" />
+					<xsl:variable name="yAllStep" select="$yAllDelta*$yAllScale" />
+					<xsl:variable name="totalHeight" select="floor($_verticalSpan+$bottom+2*$yStep)" />
+					<xsl:variable name="totalHeight2" select="floor($_verticalSpan+$bottom2+2*$y2Step)" />
+					<xsl:variable name="totalHeightAll" select="floor($_verticalSpan+$bottomAll+2*$yAllStep)" />
+					
+					<xsl:variable name="yStart">
+						<xsl:choose>
+							<xsl:when test="$yDataMin &lt; 0">
+								<xsl:value-of select="$bottom - $yStep" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="$bottom" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="y2Start">
+						<xsl:choose>
+							<xsl:when test="$y2DataMin &lt; 0">
+								<xsl:value-of select="$bottom2 - $y2Step" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="$bottom2" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="yAllStart">
+						<xsl:choose>
+							<xsl:when test="$yAllDataMin &lt; 0">
+								<xsl:value-of select="$bottomAll - $yAllStep" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="$bottomAll" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="yCentre">
+						<xsl:choose>
+							<xsl:when test="$yMin &lt; 0">
+								<xsl:value-of select="floor($yScale*($yMax + $yDelta div 2))" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="floor($yScale*$yMax)" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="y2Centre">
+						<xsl:choose>
+							<xsl:when test="$y2Min &lt; 0">
+								<xsl:value-of select="floor($y2Scale*($y2Max + $y2Delta div 2))" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="floor($y2Scale*$y2Max)" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					<xsl:variable name="yAllCentre">
+						<xsl:choose>
+							<xsl:when test="$yAllMin &lt; 0">
+								<xsl:value-of select="floor($yAllScale*($yAllMax + $yAllDelta div 2))" />
+							</xsl:when>
+							<xsl:otherwise>
+								<xsl:value-of select="floor($yAllScale*$yAllMax)" />
+							</xsl:otherwise>
+						</xsl:choose>
+					</xsl:variable>
+					
+					<!-- Print centre -->
+					<svg:circle cx="{$xMin}" cy="{$totalHeightAll}" r="1" /><!-- $yCentre $yAllCentre -->
+					<xsl:variable name="labelDelta" select="number($FONT_SIZE) div 2" />
+					<!-- Print y-axis -->
+					<xsl:comment>130 printYAxis 
+						yDataMin = <xsl:value-of select="$yDataMin"/> - <xsl:value-of select="$yDataMin"/> 
+					 							
+												yDataMax = <xsl:value-of select="$yDataMax"/>
+												y2DataMax = <xsl:value-of select="$y2DataMax"/>
+											$xMin = <xsl:value-of select="$xMin"/>
+						$yDataMax = <xsl:value-of select="$yDataMax"/>
+						$y2DataMax = <xsl:value-of select="$y2DataMax"/>
+						$yAllDataMax = <xsl:value-of select="$yAllDataMax"/>
+						
+						$_verticalSpan = <xsl:value-of select="$_verticalSpan"/>
+						$topPadding = <xsl:value-of select="$topPadding"/>
+						yDelta = <xsl:value-of select="$yDelta"/>
+						y2Delta = <xsl:value-of select="$y2Delta"/>
+						yAllDelta = <xsl:value-of select="$yAllDelta"/> = roundO($yAllDataMax - $yAllDataMin) div $yAllCount)*2
+						
+						$yDataMin = <xsl:value-of select="$yDataMin"/>
+						$y2DataMin = <xsl:value-of select="$y2DataMin"/>
+						$yAllDataMin = <xsl:value-of select="$yAllDataMin"/>
+						
+						$xData.name = <xsl:value-of select="$xData.name"/>
+						$yScale = <xsl:value-of select="$yScale"/>
+						$y2Scale = <xsl:value-of select="$y2Scale"/>
+						$yAllScale = <xsl:value-of select="$yAllScale"/> = $_verticalSpan=<xsl:value-of select="$_verticalSpan"/> div ( $yAllDataMax=<xsl:value-of select="$yAllDataMax"/> - $yAllDataMin=<xsl:value-of select="$yAllDataMin"/> )
+						
+						$labelDelta = <xsl:value-of select="$labelDelta"/>
+						$yMin = <xsl:value-of select="$yMin"/>
+						$y2Min = <xsl:value-of select="$y2Min"/>
+						$yAllMin = <xsl:value-of select="$yAllMin"/>
+						
+						$xMax = <xsl:value-of select="$xMax"/>
+						
+						$yMax = <xsl:value-of select="$yMax"/>
+						$y2Max = <xsl:value-of select="$y2Max"/>
+						$yAllMax = <xsl:value-of select="$yAllMax"/>
+						
+						$leftPadding = <xsl:value-of select="$leftPadding"/>
+						
+						$bottom = <xsl:value-of select="$bottom"/>
+						$bottom2 = <xsl:value-of select="$bottom2"/>
+						$bottomAll = <xsl:value-of select="$bottomAll"/>
+						
+						$yStep = <xsl:value-of select="$yStep"/>
+						$y2Step = <xsl:value-of select="$y2Step"/>
+						$yAllStep = <xsl:value-of select="$yAllStep"/>
+						
+						$totalHeight = <xsl:value-of select="$totalHeight"/>
+						$totalHeight2 = <xsl:value-of select="$totalHeight2"/>
+						$totalHeightAll = <xsl:value-of select="$totalHeightAll"/>
+						
+						$yStart = <xsl:value-of select="$yStart"/>
+						$y2Start = <xsl:value-of select="$y2Start"/>
+						$yAllStart = <xsl:value-of select="$yAllStart"/>
+						
+						$yCentre = <xsl:value-of select="$yCentre"/>
+						$y2Centre = <xsl:value-of select="$y2Centre"/>
+						$yAllCentre = <xsl:value-of select="$yAllCentre"/>
+						
+						$yCount = <xsl:value-of select="$yCount"/>
+						$y2Count = <xsl:value-of select="$y2Count"/>
+						$yAllCount = <xsl:value-of select="$yAllCount"/>
+						
+					</xsl:comment>
+					
+					
+					
+					<!--<xsl:variable name="step" select="$yDelta"/>-->
+					<!--<xsl:for-each select="$Data.analyzed//xData.name">
+						<xsl:variable name="index" select="number(@pos)+$step"/>
+						<xsl:variable name="y">
+							<xsl:choose>
+								<xsl:when test="$yMin &lt; 0">
+									<xsl:value-of select="floor($yScale*($yMax - $index + $step div 2))" />
+								</xsl:when>
+								<xsl:otherwise>
+									<xsl:value-of select="floor($yScale*($yMax - $index))" />
+								</xsl:otherwise>
+							</xsl:choose>
+						</xsl:variable>
+						<!-\-<svg:text x="{($xMin - 5)}"
+							y="{($y + number($labelDelta))}"
+							 
+							text-anchor="end" 
+							fill="black" 
+							font-family="{$FONT}"
+							font-weight="bold"
+							font-size="{$FONT_SIZE}"
+							xmlns:svg="http://www.w3.org/2000/svg">
+							<xsl:value-of select="text()" /><!-\\- testf="{floor($yScale*($yMax - $index))}"
+							  testf2="{($yMax - $index)}"
+							  testf3="{$yMax}"
+							  index="{$index}" -\\->
+						</svg:text>-\->
+						
+						
+					</xsl:for-each>-->
+					<xsl:call-template name="p5gnuplot:printYAxis">
+						<xsl:with-param name="totalHeightAll" select="$totalHeightAll"/>
+						<xsl:with-param name="yDelta" select="$yDelta"/>
+						<xsl:with-param name="y2Delta" select="$y2Delta"/>
+						<xsl:with-param name="yAllDelta" select="$yAllDelta"/>
+						<xsl:with-param name="index" select="$yMin" />
+						<xsl:with-param name="index2" select="$y2Min" />
+						<xsl:with-param name="step" select="$yDelta" />
+						<xsl:with-param name="step2" select="$y2Delta" />
+						<xsl:with-param name="stepAll" select="$yAllDelta" />
+						
+						<xsl:with-param name="viewBoxHeight" select="$viewBoxHeight"/>
+						
+						<xsl:with-param name="xMin" select="$xMin" />
+						<xsl:with-param name="xMax" select="$xMax" />
+						<xsl:with-param name="yMin" select="$yMin" />
+						<xsl:with-param name="y2Min" select="$y2Min" />
+						<xsl:with-param name="yAllMin" select="$yAllMin" />
+						<xsl:with-param name="yAllDataMin" select="$yAllDataMin"/>
+						<xsl:with-param name="yMax" select="$yMax" />
+						<xsl:with-param name="y2Max" select="$y2Max" />
+						<xsl:with-param name="yAllMax" select="$yAllMax" />
+						<xsl:with-param name="yAllDataMax" select="$yAllDataMax"/>
+						<xsl:with-param name="yScale" select="$yScale" />
+						<xsl:with-param name="y2Scale" select="$y2Scale" />
+						<xsl:with-param name="yAllScale" select="$yAllScale" />
+						
+						<xsl:with-param name="Data.analyzed" select="$Data.analyzed" tunnel="yes"/>
+					</xsl:call-template>
+					
+					
+					<xsl:comment>#253 after text</xsl:comment>
+					
+					
+					<svg:g transform="translate(0 {$totalHeight}) scale(1 -1)">
+						<svg:line x1="{$xMin}" y1="{$yStart}" x2="{$xMin}" y2="{$totalHeight}"
+							deb="569_os_pion_1"
+							stroke="black" stroke-width="2" />
+					</svg:g>
+					
+					<!--<xsl:call-template name="printYAxis">
+						<xsl:with-param name="index" select="$yMin" />
+						<xsl:with-param name="step" select="$yDelta" />
+						<xsl:with-param name="xMin" select="$xMin" />
+						<xsl:with-param name="xMax" select="$xMax" />
+						<xsl:with-param name="yMin" select="$yMin" />
+						<xsl:with-param name="yMax" select="$yMax" />
+						<xsl:with-param name="yScale" select="$yScale" />
+					</xsl:call-template>-->
+					<!--<svg:g transform="translate(0 {$totalHeight}) scale(1 -1)">
+						<svg:line x1="{$xMin}" y1="{$yStart}" x2="{$xMin}" y2="{$totalHeight}"
+							stroke="black" stroke-width="2" />
+					</svg:g>-->
+					<xsl:comment>#301 after text</xsl:comment>
+					<!-- Print bars -->
+					<svg:g transform="translate(0 {$totalHeightAll}) scale(1 -1)"><!-- $yCentre -->
+						<xsl:for-each select="$Data.analyzed//xData.name">
+							<xsl:variable name="colour">
+								<xsl:call-template name="colour">
+									<xsl:with-param name="index" select="number(@pos)" /><!-- position() -->
+								</xsl:call-template>
+							</xsl:variable>
+							<!--<xsl:variable name="height" select="$Data.analyzed//yData.postition[@pos=current()/@pos]/number()*$yScale" />-->
+							
+							<!-- x0 , y250
+								 x50, y0
+							-->
+							
+							<xsl:variable name="index.context.value.y" select="$Data.analyzed//yData.postition[@pos=current()/@pos]/number()"/>
+							<xsl:variable name="index.context.value.y2" select="$Data.analyzed//y2Data.postition[@pos=current()/@pos]/number()"/>
+							<xsl:variable name="y" select="$viewBoxHeight - (( $viewBoxHeight div $yAllDataMax )  * $index.context.value.y)"/><!-- $totalHeightAll - (( $totalHeightAll div ($yAllDataMax - $yAllDataMin) )  * $index.context.value.y)  -->
+							
+							<xsl:variable name="y2" select="(( $totalHeightAll div ($yAllDataMax - $yAllDataMin) )  * ($index.context.value.y - $index.context.value.y2 ))"/>
+							
+							<!--<xsl:variable name="height2" select="$y2Scale * $index.context.value.y2" />--><!--$Data.analyzed//y2Data.postition[@pos=current()/@pos]/number()*$yAllScale $y2Scale -->
+							
+							<xsl:variable name="y">
+								<xsl:call-template name="absolute">
+									<xsl:with-param name="number" select="$y" /><!-- - number($topPadding) -->
+								</xsl:call-template>
+							</xsl:variable>
+							<xsl:variable name="y2.as.height" select="((( $totalHeightAll div $yAllDataMax )  * (($index.context.value.y - $index.context.value.y2) )) ) " />
+							<xsl:variable name="y2.as.height">
+								<xsl:call-template name="absolute">
+									<xsl:with-param name="number" select="floor($y2.as.height) " /><!-- - number($topPadding) -->
+								</xsl:call-template>
+							</xsl:variable>
+							<!--<xsl:variable name="absoluteHeight2">
+								<xsl:call-template name="absolute">
+									<xsl:with-param name="number" select="floor($height2)" />
+								</xsl:call-template>
+							</xsl:variable>-->
+							<!--<xsl:variable name="y">
+								<xsl:choose>
+									<xsl:when test="$Data.analyzed//yData.postition[@pos=current()/@pos]/number()">
+										<xsl:value-of select="$Data.analyzed//yData.postition[@pos=current()/@pos]/number()*$yAllScale"/><!-\- $yScale -\->
+									</xsl:when>
+									<!-\-<xsl:when test="$height &gt;= 0">
+										<xsl:value-of select="0" />
+									</xsl:when>-\->
+									<!-\-<xsl:otherwise>
+										<xsl:value-of select="$height" />
+									</xsl:otherwise>-\->
+									<xsl:otherwise>
+										<xsl:message terminate="yes">330 error</xsl:message>
+									</xsl:otherwise>
+								</xsl:choose>
+							</xsl:variable>-->
+							
+							<svg:rect x="{$xMin+(position() - 1)*$barWidth}" y="{abs($y - $topPadding)}" rx="2" ry="2"
+								width="{$barWidth}" height="{abs($y2.as.height - 5)}" deb="#620 grafy $y2Scale={$y2Scale} all {$yAllScale} pos{position()} valy={$index.context.value.y} valy2={$index.context.value.y2} y2.as.height={$y2.as.height} $totalHeight={$totalHeight} $yAllCentre={$yAllCentre} $yAllDataMax{$yAllDataMax} $topPadding={$topPadding}"
+								fill="{$colour}" stroke="black" stroke-width="1" />
+						</xsl:for-each>
+					</svg:g>
+					
+					<xsl:comment>#334 after bars</xsl:comment>
+					
+					<!-- Print x-axis -->
+					<svg:g transform="translate(0 {$totalHeightAll})"><!-- $yAllCentre $yCentre -->
+						<!--<xsl:call-template name="p5gnuplot:printXAxis">
+							<xsl:with-param name="xData" select="$Data.analyzed//xData.postition" /><!-\- $xData.postition -\->
+							<xsl:with-param name="step" select="$barWidth" />
+							<xsl:with-param name="xMin" select="$xMin+$barWidth div 2" />
+							<xsl:with-param name="xMax" select="$yCount" />
+							<xsl:with-param name="Data.analyzed" select="$Data.analyzed" tunnel="yes"/><!-\- $Data.analyzed -\->
+						</xsl:call-template>-->
+						<xsl:call-template name="p5gnuplot:printXAxis">
+							<xsl:with-param name="xData" select="$Data.analyzed//xData.postition" /><!-- $xData.postition -->
+							<xsl:with-param name="step" select="$barWidth" />
+							<xsl:with-param name="xMin" select="$xMin+$barWidth div 2" />
+							<xsl:with-param name="xMax" select="$yCount" />
+							<xsl:with-param name="Data.analyzed" select="$Data.analyzed" tunnel="yes"/><!-- $Data.analyzed -->
+						</xsl:call-template>
+						<xsl:comment>#352 after </xsl:comment>
+						<svg:line x1="{$xMin}" y1="0" x2="{$xMax}" y2="0" stroke="black" stroke-width="2"  deb="#647"/>
+					</svg:g>
+					
+					<xsl:comment>#355 test
+						<xsl:for-each select="$Data.analyzed//xData.postition">
+							pos=<xsl:value-of select="position()"/>
+						</xsl:for-each>
+					</xsl:comment>
+					
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:comment>#466 error max($Data.analyzed//yData.postition/number()) &gt; 0 and
+					max($Data.analyzed//y2Data.postition/number()) &gt; 0
+					</xsl:comment>
+				</xsl:otherwise>
+			</xsl:choose>
+		</svg:svg>
+	</xsl:template>
+
+
 	<!-- Prints a simple bar chart with grid -->
-	<xsl:template name="barChart">
+	<!--<xsl:template name="barChart">
 		<xsl:param name="xData" />
 		<xsl:param name="yData" />
 		<xsl:param name="width" select="'100%'" />
@@ -110,11 +808,11 @@ Redistribution and use, with or without modification, are permitted provided tha
 				</xsl:variable>
 
 
-				<!-- Print centre -->
-				<svg:circle cx="{$xMin}" cy="{$yCentre}" r="1" />
+				<!-\- Print centre -\->
+				<!-\-<svg:circle cx="{$xMin}" cy="{$yCentre}" r="1" />-\->
 
-				<!-- Print y-axis -->
-				<xsl:call-template name="printYAxis">
+				<!-\- Print y-axis -\->
+				<!-\-<xsl:call-template name="printYAxis">
 					<xsl:with-param name="index" select="$yMin" />
 					<xsl:with-param name="step" select="$yDelta" />
 					<xsl:with-param name="xMin" select="$xMin" />
@@ -122,14 +820,14 @@ Redistribution and use, with or without modification, are permitted provided tha
 					<xsl:with-param name="yMin" select="$yMin" />
 					<xsl:with-param name="yMax" select="$yMax" />
 					<xsl:with-param name="yScale" select="$yScale" />
-				</xsl:call-template>
-				<svg:g transform="translate(0 {$totalHeight}) scale(1 -1)">
+				</xsl:call-template>-\->
+				<!-\-<svg:g transform="translate(0 {$totalHeight}) scale(1 -1)">
 					<svg:line x1="{$xMin}" y1="{$yStart}" x2="{$xMin}" y2="{$totalHeight}"
 						stroke="black" stroke-width="2" />
-				</svg:g>
+				</svg:g>-\->
 
-				<!-- Print bars -->
-				<svg:g transform="translate(0 {$yCentre}) scale(1 -1)">
+				<!-\- Print bars -\->
+				<!-\-<svg:g transform="translate(0 {$yCentre}) scale(1 -1)">
 					<xsl:for-each select="$yData">
 						<xsl:variable name="colour">
 							<xsl:call-template name="colour">
@@ -157,10 +855,10 @@ Redistribution and use, with or without modification, are permitted provided tha
 						    width="{$barWidth}" height="{$absoluteHeight}"
 							fill="{$colour}" stroke="black" stroke-width="1" />
 					</xsl:for-each>
-				</svg:g>
+				</svg:g>-\->
 
-				<!-- Print x-axis -->
-				<svg:g transform="translate(0 {$yCentre})">
+				<!-\- Print x-axis -\->
+				<!-\-<svg:g transform="translate(0 {$yCentre})">
 					<xsl:call-template name="printXAxis">
 						<xsl:with-param name="xData" select="$xData" />
 						<xsl:with-param name="step" select="$barWidth" />
@@ -168,8 +866,8 @@ Redistribution and use, with or without modification, are permitted provided tha
 						<xsl:with-param name="xMax" select="$yCount" />
 					</xsl:call-template>
 					<svg:line x1="{$xMin}" y1="0" x2="{$xMax}" y2="0" stroke="black" stroke-width="2" />
-				</svg:g>
+				</svg:g>-\->
 			</xsl:if>
 		</svg:svg>
-	</xsl:template>
+	</xsl:template>-->
 </xsl:stylesheet>

+ 49 - 17
SE/schema/WPS_Functions/SvgCharts4Xsl/charts.xsl

@@ -1,24 +1,56 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-Original Author: Frankline Francis
 
-Copyright (c) 2012, Imaginea. All rights reserved.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND DEVELOPERS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Redistribution and use, with or without modification, are permitted provided that the following conditions are met:
-    # Redistribution of source code must retain the above copyright notice, this list of conditions and the disclaimer.
-    # Neither the name of Imaginea nor the names of the developers may be used to endorse or promote products derived from
-      this software without specific prior written permission.
--->
-<xsl:stylesheet version="1.0"
+<xsl:stylesheet version="2.0"
+	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:xsl="http://www.w3.org/1999/XSL/Transform">
 	<xsl:import href="linechart.xsl" />
 	<xsl:import href="barchart.xsl" />
 	<xsl:import href="piechart.xsl" />
+	
+	<xsl:output indent="yes"/>
+	
+	
+	
+	<!--<xsl:template mode="barChart" match="barChart">
+		<!-\-<xsl:copy>-\->
+		<xsl:apply-templates mode="barChart"/>
+		<!-\-</xsl:copy>-\->
+	</xsl:template>-->
+	
+	<xsl:template mode="barChart" match="row">
+		<!--<xsl:call-template name="barChart">
+			<xsl:with-param name="xData" select="xData"/>
+			<xsl:with-param name="yData" select="yData"/>
+		</xsl:call-template>-->
+	</xsl:template>
+	
+	
+	<xsl:template mode="barChart" match="svg-container">
+		<xsl:copy>
+			<xsl:copy-of select="@*"/>
+				<xsl:apply-templates mode="#current"/>
+		</xsl:copy>
+	</xsl:template>
+	
+	<xsl:template mode="barChart" match="*">
+		
+	</xsl:template>
+	
+	
+	<xsl:template mode="barChart" match="barChart">
+		<xsl:call-template name="p5gnuplot:SvgCharts4Xsl" >
+			<xsl:with-param name="xData.name" select="*[relation_DateRangeElements]/nazwa"/>
+			<xsl:with-param name="xData.postition" select="*[relation_DateRangeElements]/position()"/><!-- BI_audit_KRS/position() -->
+			<!--<xsl:with-param name="yData" select="BI_audit_KRS/relation_DateRangeElements/leadingTimeDate-From"/>
+			<xsl:with-param name="y2Data" select="BI_audit_KRS/relation_DateRangeElements/leadingTimeDate-To"/>-->
+			<!--<xsl:with-param name="yData" select="BI_audit_KRS/relation_DateRangeElements"/>-->
+			<xsl:with-param name="yData.attr" select="*[relation_DateRangeElements]/relation_DateRangeElements/system_cache__dita:year-timestamp-day(@leadingTimeDate-From)"/>
+			<xsl:with-param name="yData.attr.title" select="*[relation_DateRangeElements]/relation_DateRangeElements/@leadingTimeDate-From"/>
+			<!--<xsl:with-param name="y2Data" select="BI_audit_KRS/relation_DateRangeElements"/>-->
+			<xsl:with-param name="y2Data.attr" select="*[relation_DateRangeElements]/relation_DateRangeElements/system_cache__dita:year-timestamp-day(@leadingTimeDate-To)"/>
+			<xsl:with-param name="y2Data.attr.title" select="*[relation_DateRangeElements]/relation_DateRangeElements/@leadingTimeDate-To"/>
+		</xsl:call-template>
+	</xsl:template>
+	
 </xsl:stylesheet>

+ 165 - 2
SE/schema/WPS_Functions/SvgCharts4Xsl/common.xsl

@@ -16,7 +16,9 @@ Redistribution and use, with or without modification, are permitted provided tha
     # Neither the name of Imaginea nor the names of the developers may be used to endorse or promote products derived from
       this software without specific prior written permission.
 -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="2.0" 
+	xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
 	<!-- Constants -->
 	<xsl:variable name="COLOURS" select="document('colours.xml')/colours/colour" />
@@ -68,12 +70,36 @@ Redistribution and use, with or without modification, are permitted provided tha
 	</xsl:template>
 
 	<!-- Helper template to print x-axis -->
+	<xsl:template name="p5gnuplot:printXAxis">
+		<xsl:param name="xData" />
+		<xsl:param name="step" />
+		<xsl:param name="xMin" />
+		<xsl:param name="xMax" />
+		<xsl:param name="Data.analyzed" required="yes" tunnel="yes"/>
+		<xsl:for-each select="$Data.analyzed//xData.postition"><!-- $xData -->
+			<xsl:choose>			
+				<xsl:when test="position() &lt;= $xMax">
+					<svg:text writing-mode="tb" x="{$xMin+(position() - 1)*$step}"
+						deb="#73 osie nazwy "
+						dy="5" fill="black" font-family="{$FONT}" font-weight="bold"
+						font-size="{$FONT_SIZE}" xmlns:svg="http://www.w3.org/2000/svg">
+						<!--<xsl:value-of select="." />-->
+						<xsl:value-of select="$Data.analyzed//xData.name[@pos = current()/@pos]"/>
+					</svg:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:comment>#90 error position() = <xsl:value-of select="position()"/> lt <xsl:value-of select="$xMax"/> </xsl:comment>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+	
 	<xsl:template name="printXAxis">
 		<xsl:param name="xData" />
 		<xsl:param name="step" />
 		<xsl:param name="xMin" />
 		<xsl:param name="xMax" />
-
+		
 		<xsl:for-each select="$xData">
 			<xsl:if test="position() &lt;= $xMax">
 				<svg:text writing-mode="tb" x="{$xMin+(position() - 1)*$step}"
@@ -126,4 +152,141 @@ Redistribution and use, with or without modification, are permitted provided tha
 			</xsl:call-template>
 		</xsl:if>
 	</xsl:template>
+	
+	
+	
+	<xsl:template name="p5gnuplot:printYAxis">
+		<xsl:param name="index.context.position" select="1"/>
+		<xsl:param name="index" />
+		<xsl:param name="index2" />
+		<xsl:param name="step" />
+		<xsl:param name="step2" />
+		<xsl:param name="stepAll" />
+		
+		<xsl:param name="yDelta"/>
+		<xsl:param name="y2Delta"/>
+		<xsl:param name="yAllDelta"/>
+		<xsl:param name="yAllDataMax" />
+		<xsl:param name="xMin" />
+		<xsl:param name="xMax" />
+		<xsl:param name="yMin" />
+		<xsl:param name="y2Min" />
+		<xsl:param name="yAllMin" />
+		<xsl:param name="yMax" />
+		<xsl:param name="y2Max" />
+		<xsl:param name="yAllMax" />
+		<xsl:param name="viewBoxHeight"/>
+		<xsl:param name="yAllDataMin"/>
+		<xsl:param name="yScale" />
+		<xsl:param name="y2Scale" />
+		<xsl:param name="yAllScale" />
+		<xsl:param name="totalHeightAll"/>
+		<xsl:param name="Data.analyzed" required="yes" tunnel="yes"/>
+		<xsl:variable name="labelDelta" select="$FONT_SIZE div 2" />
+		<xsl:variable name="index.context.value.y" select="$Data.analyzed//yData.postition[@pos=$index.context.position]/text()"/>
+		<xsl:variable name="index.context.value.y2" select="$Data.analyzed//y2Data.postition[@pos=$index.context.position]/text()"/>
+		
+		<xsl:if test="$Data.analyzed//yData.postition[@pos=$index.context.position]"><!-- $index &lt; $yMax -->
+				<!--<xsl:variable name="y" select="$totalHeightAll - ($yDelta * $index.context.value.y) "/>-->
+			<!--<xsl:variable name="y.test" select="$viewBoxHeight - (($viewBoxHeight div ($yAllDataMax - $yAllDataMin)) * ($index.context.value.y - $yAllDataMin))"/>-->
+			<xsl:variable name="y" select="$viewBoxHeight - (($viewBoxHeight div ($yAllDataMax - $yAllDataMin)) * ($index.context.value.y - $yAllDataMin))">
+				<!--<xsl:choose>
+					<xsl:when test="$yAllMin &lt; 0"><!-\- $yMin -\->
+						<xsl:value-of select="floor($yAllScale*($yAllMax - $index.context.value.y + $stepAll div 2))" /><!-\-$index  $step $yMax $yScale-\->
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="floor($yAllScale*($yAllMax - $index.context.value.y))" /><!-\- $index$yMax $yScale -\->
+					</xsl:otherwise>
+				</xsl:choose>-->
+			</xsl:variable>
+			
+			<xsl:variable name="y2.test" select="$viewBoxHeight - (( $viewBoxHeight div $yAllDataMax ) * $index.context.value.y2 ) "/>
+			<xsl:variable name="y2" select="$viewBoxHeight - (($viewBoxHeight div ($yAllDataMax - $yAllDataMin)) * ( $index.context.value.y2 - $yAllDataMin )) "><!-- $totalHeightAll - ($y2Delta * $index.context.value.y2)  -->
+				<!--<xsl:choose>
+					<xsl:when test="$yAllMin &lt; 0"><!-\- $y2Min -\->
+						<xsl:value-of select="floor($yAllScale*($yAllMax - $index.context.value.y2 + $stepAll div 2))" /><!-\-$index2 $y2Max $yScale -\->
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="floor($yAllScale*($yAllMax - $index.context.value.y2))" /><!-\-$index2 $y2Max $y2Scale -\->
+					</xsl:otherwise>
+				</xsl:choose>-->
+			</xsl:variable>
+			
+			<svg:text x="{($xMin - 5)}" y="{($y + $labelDelta)}" 
+				deb="178-do-y1  val={$index.context.value.y} pos.{$index.context.position}
+				$viewBoxHeight={$viewBoxHeight} 
+				div={(($viewBoxHeight div $yAllDataMax) * $index.context.value.y)} 
+				tuned={($viewBoxHeight div ($yAllDataMax - $yAllDataMin))}
+				Mx-Min={($yAllDataMax - $yAllDataMin)}
+				Vb_div(Mx-Min)={($viewBoxHeight div ($yAllDataMax - $yAllDataMin))}
+				V-Admin={($index.context.value.y - $yAllDataMin)}
+				V-divAdmax={($index.context.value.y div $yAllDataMax)}
+				"
+				text-anchor="end" fill="black" font-family="{$FONT}" font-weight="bold"
+				font-size="{$FONT_SIZE}" xmlns:svg="http://www.w3.org/2000/svg">
+				<xsl:choose>
+					<xsl:when test="$Data.analyzed//yData.postition[@pos=$index.context.position]/@yData.attr.title">
+						<xsl:value-of select="$Data.analyzed//yData.postition[@pos=$index.context.position]/@yData.attr.title" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$index.context.value.y" />
+					</xsl:otherwise>
+				</xsl:choose>
+				
+				<!--<xsl:value-of select="' $y '"/>
+				<xsl:value-of select="$y"/>-->
+			</svg:text>
+			
+			<svg:text x="{($xMin - 5)}" y="{($y2 + $labelDelta)}" deb="178-do-y2 $y2.test={$y2.test} val={$index.context.value.y2} pos.{$index.context.position}"
+				text-anchor="end" fill="black" font-family="{$FONT}" font-weight="bold"
+				font-size="{$FONT_SIZE}" xmlns:svg="http://www.w3.org/2000/svg">
+				
+				<xsl:choose>
+					<xsl:when test="$Data.analyzed//y2Data.postition[@pos=$index.context.position]/@y2Data.attr.title">
+						<xsl:value-of select="$Data.analyzed//y2Data.postition[@pos=$index.context.position]/@y2Data.attr.title" />
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$index.context.value.y2" />
+					</xsl:otherwise>
+				</xsl:choose>
+				
+				<!--<xsl:value-of select="' $y2 '"/>
+				<xsl:value-of select="$y2"/>-->
+			</svg:text>
+			
+			<svg:line x1="{$xMin}" y1="{$y}" x2="{$xMax}" y2="{$y}" deb="#210A-all-os-tylko poziomy tik1"
+				stroke="grey" stroke-width="0.25" xmlns:svg="http://www.w3.org/2000/svg" />
+			<svg:line x1="{$xMin}" y1="{$y2}" x2="{$xMax}" y2="{$y2}" deb="#210B-all-os-tylko poziomy tik2"
+				stroke="grey" stroke-width="0.25" xmlns:svg="http://www.w3.org/2000/svg" />
+			
+			<xsl:call-template name="p5gnuplot:printYAxis">
+				<xsl:with-param name="index.context.position" select="$index.context.position + 1"/>
+				<xsl:with-param name="index" select="$index+$step" />
+				<xsl:with-param name="index2"  select="$index2+$step2"/>
+				<xsl:with-param name="step" select="$step" />
+				<xsl:with-param name="step2" select="$step2" />
+				<xsl:with-param name="stepAll" select="$stepAll" />
+				<xsl:with-param name="xMin" select="$xMin" />
+				<xsl:with-param name="xMax" select="$xMax" />
+				<xsl:with-param name="yMin" select="$yMin" />
+				<xsl:with-param name="y2Min"  select="$y2Min"/>
+				<xsl:with-param name="yAllMin"  select="$yAllMin"/>
+				<xsl:with-param name="yMax" select="$yMax" />			
+				<xsl:with-param name="y2Max" select="$y2Max" />
+				<xsl:with-param name="yAllMax" select="$yAllMax" />
+				<xsl:with-param name="yAllDataMax" select="$yAllDataMax"/>
+				<xsl:with-param name="viewBoxHeight" select="$viewBoxHeight"/>
+				<xsl:with-param name="yDelta" select="$yDelta"/>
+				<xsl:with-param name="y2Delta" select="$y2Delta"/>
+				<xsl:with-param name="yAllDelta" select="$yAllDelta"/>
+				<xsl:with-param name="yAllDataMin" select="$yAllDataMin"/>
+				<xsl:with-param name="totalHeightAll" select="$totalHeightAll"/>
+				<xsl:with-param name="yScale" select="$yScale" />
+				<xsl:with-param name="y2Scale" select="$y2Scale" />
+				<xsl:with-param name="yAllScale" select="$y2Scale" />
+				<xsl:with-param name="Data.analyzed" select="$Data.analyzed" tunnel="yes"/>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+	
 </xsl:stylesheet>

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

@@ -82,6 +82,21 @@
         </default_db__x3A__BI_audit_BENFORD:CostField>
     </xsl:template>
     
+    <xsl:template name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" >
+        <xsl:choose>
+            <xsl:when test="string-length($system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_UMOWY.CostSubjectFields) &gt;0">
+                <default_db__x3A__BI_audit_BENFORD:CostSubjectFields ><!-- default_db__x3A__BI_audit_BENFORD:leadingFallbackFieldRegex="[a-zA-Z]+" -->
+                    <!--<xsl:value-of select="'Wartosc_kosztowa_przedmiotu_umowy_netto_w_walucie__aktualna_'"/>-->
+                    <!--<xsl:text>Glowny_numer_rejestrowy,Rejestrujacy_w_RUM___nazwisko_i_imie,Typ_umowy__aktualny_,Koniec_okresu_obowiazywania_umowy,Slowa_kluczowe_okreslajace_umowe,Numer_rejestrowy_u_Kontrahenta</xsl:text>-->
+                    <!--<default_db__x3A__BI_audit_BENFORD:leadingFallbackField><xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_UMOWY.Wartosc_przedmiotu_umowy_netto_w_PLN__aktualna_"/></default_db__x3A__BI_audit_BENFORD:leadingFallbackField>-->
+                    <!--<default_db__x3A__BI_audit_BENFORD:leadingFallbackField>Wartosc_przedmiotu_umowy_netto_w_PLN__aktualna_</default_db__x3A__BI_audit_BENFORD:leadingFallbackField>-->
+                    <xsl:value-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_UMOWY.CostSubjectFields"/>
+                </default_db__x3A__BI_audit_BENFORD:CostSubjectFields>
+            </xsl:when>
+        </xsl:choose>
+        
+    </xsl:template>
+    
  
     <xsl:template name="default_db__x3A__BI_audit_BENFORD:groupField" >
         <default_db__x3A__BI_audit_BENFORD:groupField>
@@ -194,6 +209,10 @@
                 <xsl:variable name="default_db__x3A__BI_audit_BENFORD:groupField">
                     <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:groupField"/>
                 </xsl:variable>
+                <xsl:variable name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields">
+                    <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"/>
+                </xsl:variable>
+                
                 <xsl:result-document href="{system_cache__dita:files.key.href.write.topic.context(.)}"> 
                     <topic props="raport.BT">
                         <xsl:copy-of select="system_cache__dita:files.key.topic.attrs.context(.,'topic')"/>
@@ -205,6 +224,7 @@
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                             </xsl:apply-templates>
                         </title>
                         <body>
@@ -216,6 +236,7 @@
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                             </xsl:apply-templates>
                             </ol>
                         </body>
@@ -229,6 +250,7 @@
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                 </xsl:call-template>
                 
                 
@@ -238,6 +260,7 @@
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                 </xsl:apply-templates>
             </topicref>
             
@@ -261,13 +284,17 @@
                 <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:NameField"/>
             </xsl:variable>
             
+            <xsl:variable name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields">
+                <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"/>
+            </xsl:variable>
+            
             <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:NWK3">
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField" select="$default_db__x3A__BI_audit_BENFORD:valueField" tunnel="yes" />
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:groupField" select="$default_db__x3A__BI_audit_BENFORD:groupField" tunnel="yes" />
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
-                
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
             </xsl:call-template>
             <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:BNWK3T">
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField" select="$default_db__x3A__BI_audit_BENFORD:valueField" tunnel="yes" />
@@ -275,6 +302,7 @@
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
             </xsl:call-template>
             <xsl:choose>
                 <xsl:when test="number($default_db__x3A__BI_audit_BENFORD.BI_audit_BENFORD.deal_analys__x3A__enable.param) &gt;0">
@@ -284,6 +312,7 @@
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                     </xsl:call-template>
                 </xsl:when>
             </xsl:choose>
@@ -310,6 +339,7 @@
                             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                         </xsl:apply-templates>
                     </xsl:result-document>
                 </topicref>
@@ -331,6 +361,7 @@
                                  <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                                  <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                                  <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                              </xsl:apply-templates>
                          </xsl:result-document>
         
@@ -355,6 +386,7 @@
                             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
                             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
                             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                         </xsl:apply-templates>
                     </xsl:result-document>
                 </xsl:when>
@@ -371,6 +403,7 @@
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:timeField"  tunnel="yes"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:NameField"  tunnel="yes"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostField"  tunnel="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"  tunnel="yes"/>
         <xsl:attribute name="navtitle">
         <xsl:choose>
             <xsl:when test="firstStep">

+ 15 - 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

@@ -82,6 +82,7 @@
         <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="default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes" required="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"  tunnel="yes"/>
         <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:leadingNumber">
             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField"/>
         </xsl:call-template>
@@ -131,6 +132,8 @@
         </xsl:choose>
         
         
+        
+        
         <xsl:choose>
             
             <xsl:when test="local-name()=$default_db__x3A__BI_audit_BENFORD:CostField/default_db__x3A__BI_audit_BENFORD:CostField[1]/text()[1] and number(text())&gt;0 and ( matches(text(),$default_db__x3A__BI_audit_BENFORD:CostField//@default_db__x3A__BI_audit_BENFORD:leadingFallbackFieldRegex[1]) or not($default_db__x3A__BI_audit_BENFORD:CostField//@default_db__x3A__BI_audit_BENFORD:leadingFallbackFieldRegex))">
@@ -218,6 +221,14 @@
         </xsl:call-template>
         
         
+        <xsl:for-each select="tokenize($default_db__x3A__BI_audit_BENFORD:CostSubjectFields,',')">
+            <xsl:choose>
+                <xsl:when test="$current/local-name() = current() and string-length($current/text()) &gt;0 ">
+                    <xsl:attribute name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields.{$current/local-name()}" select="$current/text()"/>
+                </xsl:when>
+            </xsl:choose>
+        </xsl:for-each>
+        
     </xsl:template>
     
     <xsl:template name="default_db__x3A__BI_audit_BENFORD:generate.leadingNumber.column">
@@ -265,6 +276,10 @@
         <xsl:copy-of select="."/>
     </xsl:template>
     
+    <xsl:template mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs" match="@*[contains(name(),'default_db__x3A__BI_audit_BENFORD:')]">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+    
     
     <xsl:template mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs" match="@*"/>
     

+ 81 - 2
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.universal.xsl

@@ -10,6 +10,7 @@
     xmlns:p5="https://biuro.biall-net.pl/wfs"
     xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
     xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA="https://biuro.biall-net.pl/wfs/default_db/ENERGA_RUM_KONTRAHENCI_POWIAZANIA"
+    xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
     exclude-result-prefixes="xs p5 get_wfs system_cache__dita"
     version="2.0">
     
@@ -803,6 +804,8 @@
                         </xsl:choose>
                         
                         <xsl:if test="position() = last()">
+                            <!-- APU4_umowy_BI_audit_ENERGA_RUM_KONTRAHENCI.81508 -->
+                            <xsl:comment>#807</xsl:comment>
                         <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
                             <xsl:with-param name="fid"  select="parent::*//*[last()]/*[1]/@fid"/>
                             <xsl:with-param name="title">APU4_umowy</xsl:with-param>
@@ -855,14 +858,23 @@
                         <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: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" select="'image'"/>
                                         <xsl:with-param name="title" select="'APU4_umowy'"/>
-                                        <!--<xsl:with-param name="graph.name" select="'APU4-DPW'"/>-->
+                                        <!-\-<xsl:with-param name="graph.name" select="'APU4-DPW'"/>-\->
                                         <xsl:with-param name="graph.name" select="'APU4-DKW'"/>
                                         <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
                                         <xsl:with-param name="width" select="100"/>
+                                    </xsl:call-template>-->
+                                    <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" select="'image'"/>
+                                        <xsl:with-param name="title" select="'APU4_umowy'"/>
+                                        <!--<xsl:with-param name="graph.name" select="'APU4-DPW'"/>-->
+                                        <xsl:with-param name="graph.name" select="'APU4-DW'"/>
+                                        <xsl:with-param name="get_wfs:name_from_fid" select="''"/>
+                                        <xsl:with-param name="width" select="80"/>
                                     </xsl:call-template>
                                 </xsl:when>
                                 <xsl:otherwise>
@@ -883,8 +895,75 @@
             </xsl:for-each>
         </simpletable>
         
+        
+        
+        
+        <xsl:variable name="p5gnuplot:barChart_row_object">
+            <xsl:call-template name="p5gnuplot:barChart_row_object"/>
+        </xsl:variable>
+        
+        
+        
+        <foreign rev="899 test to svxg row" props="n/{name()}  cnt/row={count($p5gnuplot:barChart_row_object//relation_DateRangeElements)}">
+            <xsl:copy-of select="$p5gnuplot:barChart_row_object"></xsl:copy-of>
+        </foreign>
+        
+        <xsl:choose>
+            <xsl:when test="$p5gnuplot:barChart_row_object//relation_DateRangeElements[2]">
+                <xsl:apply-templates mode="barChart" select="$p5gnuplot:barChart_row_object"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:comment>#616 bypassed $p5gnuplot:barChart_row_object//relation_DateRangeElements[2]</xsl:comment>
+            </xsl:otherwise>
+        </xsl:choose>
+        
+        
+    </xsl:template>
+    
+    
+    <xsl:template name="p5gnuplot:barChart_row_object">
+        <svg-container rev="test994">
+        <barChart
+            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_VALIDATE="https://biuro.biall-net.pl/wfs/default_db/BI_audit_VALIDATE"
+            xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
+            xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA="https://biuro.biall-net.pl/wfs/default_db/ENERGA_RUM_KONTRAHENCI_POWIAZANIA">
+            
+            <xsl:apply-templates mode="p5gnuplot:barChart_row_object"/>
+        </barChart>
+        </svg-container>
+    </xsl:template>
+    
+    
+    <xsl:template mode="p5gnuplot:barChart_row_object" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row">
+        <xsl:comment>#997 name <xsl:value-of select="name()"/></xsl:comment>
+        <xsl:apply-templates mode="#current"/>
     </xsl:template>
     
+    <xsl:template mode="p5gnuplot:barChart_row_object" match="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row_object[relation_DateRangeElements]">
+        
+        <xsl:element name="{*[1]/name()}">
+            <xsl:copy-of select="@generate-id"/>
+            <xsl:copy-of select="@fid"/>
+            <nazwa>
+                <xsl:value-of select="*[1]/*[@default_db__x3A__BI_audit_BENFORD:NameField]"/>
+            </nazwa>
+            <!--<xsl:copy-of select="following-sibling::relation_DateRangeElements"/>-->
+            <xsl:copy-of select="relation_DateRangeElements"></xsl:copy-of>
+        </xsl:element>
+        <!--<xsl:apply-templates mode="#current" />--><!-- select="*[following-sibling::relation_DateRangeElements]" -->
+    </xsl:template>
+    
+    <!--<xsl:template mode="p5gnuplot:barChart" match="relation_DateRangeElements">
+        
+    </xsl:template>-->
+    
+    <xsl:template mode="p5gnuplot:barChart_row_object" match="*">
+        <xsl:comment>#1000 name<xsl:value-of select="name()"/></xsl:comment>
+    </xsl:template>
+    
+    <xsl:template mode="p5gnuplot:barChart_row_object" match="text()|comment()"/>
+        
     
     
     

+ 380 - 277
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.graph.deals.xsl

@@ -14,6 +14,7 @@
     xmlns:default_db__x3A__BI_audit_VALIDATE="https://biuro.biall-net.pl/wfs/default_db/BI_audit_VALIDATE"
     xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
     xmlns:system_cache__dita__x3A__p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/system_cache__dita__x3A__p5gnuplot/system_cache__dita__x3A__p5gnuplot.xsd"
+    xmlns:p5gnuplot__x3A__system_cache__dita="http://biuro.biall-net.pl/WPS_Functions/p5gnuplot__x3A__system_cache__dita/p5gnuplot__x3A__system_cache__dita.xsd"
     exclude-result-prefixes="xs "
     version="2.0"><!-- system_cache__appinfo system_cache__dita ogr Benford default_db get_wfs p5 p5gnuplot -->
     
@@ -53,10 +54,196 @@
                     
         </xsl:variable>-->
         
+        
+        <!-- LOWER METHOD UNIV -->
+        <xsl:variable name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new.config">
+            <xsl:variable name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="'default_db__x3A__BI_audit_BENFORD:leadingTimeYear'"/><!-- $default_db__x3A__BI_audit_BENFORD:FieldType -->
+            <!--<xsl:variable name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"/>-->
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/><!--'default_db__x3A__BI_audit_BENFORD:leadingTimeYear' $default_db__x3A__BI_audit_BENFORD:FieldType default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter --><!-- 'default_db__x3A__BI_audit_BENFORD:leadingTimeYear' $default_db__x3A__BI_audit_BENFORD:leadingNumber  -->
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience" select="'rozklad_'"/>
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root" select="'koszt.'"/>
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count" select="'iloscB.'"/>
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum" select="'kosztB.'"/>
+            <system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new>
+                <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="concat($graph.name,'_GEN')"/>-->
+                    <xsl:with-param name="graph.name" select="$graph.name"/>
+                    <xsl:with-param name="title" select="$title"/>
+                </xsl:call-template>
+                <!--<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props.nograph"/>-->
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:font">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:font9" select="true()"/>
+                </xsl:call-template>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:graph.ylabel">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.ylabel">Y</xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:graph.y2label">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.y2label">wartosc</xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:graph.style">
+                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.style.histogram" select="true()"/>-->
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.style.histogram.rowstacked" select="true()"/>
+                </xsl:call-template>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:no.logscale.y1"/>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:no.logscale.y2"/>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:graph.separate.outputs.auto"/>
+                
+                <system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new>
+                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.stats">
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" />
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum"/>
+                    </xsl:call-template>
+                    <system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root debug.row="60">
+                        <!-- jakim modem ma modul wyrzic spowrotem - z listy -->
+                        <!--<xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child_flag" />--><!-- czy podwojnie robic w dol -->
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.interface.for-each-group.child">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type">number</xsl:with-param>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order">ascending</xsl:with-param>
+                        </xsl:call-template>
+                        
+                                                   
+                            <system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new debug.row="94">
+                                <!--rozklad_</xsl:attribute>--><!-- w @props="graph.stats" jest inaczej   props="group.sum" current-grouping-key="100000.0" audience="rozklad_100000.0" group="kosztB.2013|3"-->
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.header">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/><!-- $default_db__x3A__BI_audit_BENFORD:FieldType --><!--  col="1">2013|3</sten -->
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>-->
+                                </xsl:call-template>
+                                
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.audience">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/>
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>-->
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>-->
+                                </xsl:call-template>
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.platform"><!-- todo ? do grupowania?  -->
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute" select="system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)"/>
+                                </xsl:call-template>
+                                
+                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/><!-- current-grouping-key="2013|3" -->
+                                
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.group"><!-- only title current-grouping-key="2013|3" group="koszt 2013|3" audience="rozklad_2013|3" col="2">koszt U.100000.0 -->
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum"/>
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>--><!-- $default_db__x3A__BI_audit_BENFORD:leadingNumber -->
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>-->
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>-->
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>-->
+                                </xsl:call-template>
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.value.sum">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                </xsl:call-template>
+                                <!--<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.color">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr" select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"/>
+                                    </xsl:call-template>-->
+                                <!--<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.yaxis">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int" select="2"/>
+                                    </xsl:call-template>-->
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.fill.style">
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc" select="2"/>--><!--with impulses-->
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.title" select="true()"/>
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle" select="true()"/>-->
+                                </xsl:call-template>
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.newhistogram">                                    
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/><!--rozklad_</xsl:with-param>-->
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>--><!-- $p5gnuplot:simpletable__x3A__graph.stats.group_by -->
+                                    
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc" >k. </xsl:with-param>
+                                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc"/>-->
+                                </xsl:call-template>
+                            </system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new>
+                    </system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root>
+                </system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new>
+            </system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new>
+        </xsl:variable>
+        
         <xsl:variable name="SIMPLETABLE_WTITLE">
+            <SIMPLETABLE_WTITLE>
+                <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root" select="$system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new.config">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset/*/*" tunnel="yes"/>
+                    <!--<xsl:with-param name="system_cache__dita:context.path.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" tunnel="yes"/>-->
+                </xsl:apply-templates>
+            </SIMPLETABLE_WTITLE>
+        </xsl:variable>
+        
+        <xsl:variable name="simpletable">
+            <xsl:call-template name="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable">
+                <xsl:with-param name="simpletable" select="$SIMPLETABLE_WTITLE"/>
+            </xsl:call-template>
+        </xsl:variable>
+        
+        <xsl:choose>
+            <xsl:when test="$simpletable//stentry">
+                <!--<xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows">
+                    <xsl:with-param name="simpletable" select="$simpletable"/>
+                    <xsl:with-param name="title"> (APU4-DT) umowy obiektu tabela </xsl:with-param>
+                </xsl:call-template>-->
+                <xsl:choose>
+                    <xsl:when test="count($simpletable/simpletable//stentry) &gt; $system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max">
+                        <p props="count_444">wielkość zbioru <xsl:value-of select="count($simpletable/simpletable//stentry)"/> - pominięto wyświetlanie tabeli</p>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <foreign rev="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl#727">
+                            <xsl:copy-of select="$simpletable/simpletable/*"/>
+                        </foreign>
+                        <foreign rev="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.graph.deals.xsl#196">
+                            <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
+                                <xsl:with-param name="title" select="$title"/>
+                                <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
+                            </xsl:apply-templates>
+                        </foreign>
+                    </xsl:otherwise>
+                </xsl:choose>
+                <xsl:comment>BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl#651 call p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze</xsl:comment>
+                <xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
+                    <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
+                </xsl:call-template>
+                <!--<p> (<xsl:value-of select="$graph.name"/>) umowy obiektu wykres </p>-->
+                <foreign rev="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl#210">
+                    <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
+                </foreign>
+                
+                <!--<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:when>
+            <xsl:otherwise>
+                <foreign rev="SIMPLETABLE_WTITLE #749">
+                    
+                    <xsl:for-each select="$SIMPLETABLE_WTITLE//*">
+                        <xsl:text>n=</xsl:text><xsl:value-of select="name()"/>
+                        <xsl:for-each select="@*">
+                            <xsl:text>@/n=</xsl:text><xsl:value-of select="name()"/>=<xsl:value-of select="."/><xsl:text>, </xsl:text>
+                        </xsl:for-each>
+                    </xsl:for-each>
+                    
+                </foreign>
+                <foreign rev="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl#759"> 
+                    brak danych kontekstowych umow - count($default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset/*/*)=<xsl:value-of select="count($default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset/*/*)"/></foreign>
+                <ph rev="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl#743">
+                    Brak danych kontekstowych  
+                </ph>
+            </xsl:otherwise>
+        </xsl:choose>
+        
+        
+        <!-- UPPER METHOD UNIV -->
+        
+        
+        <!--<xsl:variable name="SIMPLETABLE_WTITLE">
             <SIMPLETABLE_WTITLE>
                 <simpletable frame="all"
-                    props="graph.ylabel.wartosc  no.logscale.y1 no.logscale.y2  graph.style.histogram.rowstacked font15"><!-- id="ANALIZA_UMOW_4UA.graph.deals_table_2_5_{$generate_id}_{$title}" --><!-- graph.y2label.wartosc --><!-- graph.style.histogram --><!-- font15 --><!-- print__no  -->
+                    props="graph.ylabel.wartosc  no.logscale.y1 no.logscale.y2  graph.style.histogram.rowstacked font15"><!-\- id="ANALIZA_UMOW_4UA.graph.deals_table_2_5_{$generate_id}_{$title}" -\-><!-\- graph.y2label.wartosc -\-><!-\- graph.style.histogram -\-><!-\- font15 -\-><!-\- print__no  -\->
                     <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"/>
@@ -65,18 +252,18 @@
                     <strow props="graph.headers" rev="#560 $default_db__x3A__BI_audit_BENFORD:FieldType={$default_db__x3A__BI_audit_BENFORD:FieldType}">
                         <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"/>
-                            <!--<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 ]}"><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>-->
+                            <!-\-<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 ]}"><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>-\->
                             
-                            <!--<stentry debug="#567 generate-id={@generate-id}" 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 debug="#567 generate-id={@generate-id}" 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>-\->
                             
                             <xsl:for-each-group select="current-group()" group-by="@*[name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber]">
                                 <xsl:sort select="number(@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType])" 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="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>-->
-                                <!--<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>-\->
+                                <!-\-<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="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>-->
+                                    <xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>-\->
                                 
                                 
                                 
@@ -90,53 +277,53 @@
                     <strow props="graph.data">
                         <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"/>
-                            <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="count(current-group())"/></stentry>-->
-                            <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/></stentry>-->
+                            <!-\-<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="count(current-group())"/></stentry>-\->
+                            <!-\-<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/></stentry>-\->
                            
-                            <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" >
-                                <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]))"/><!-\-<xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/>-\-></stentry>-->
+                            <!-\-<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" >
+                                <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]))"/><!-\\-<xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/>-\\-></stentry>-\->
                             <xsl:variable name="current-group.parent.count" select="count(current-group())"/>
                             <xsl:variable name="current" select="current-group()"/>
                             <xsl:for-each-group select="current-group()" group-by="@*[name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber]">
                                 <xsl:sort select="number(@*[name()=$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()) div $current-group.parent.count"/></stentry>-->
-                                <!--<stentry current-grouping-key="{@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType]}" 
+                                <!-\-<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()) div $current-group.parent.count"/></stentry>-\->
+                                <!-\-<stentry current-grouping-key="{@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType]}" 
                                       audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">
                                     <xsl:attribute name="debug" select="$current//@generate-id"/>
                                     <xsl:attribute name="debug.val" select="$current//*[@*[name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:CostField])"/>
                                     <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>
                                     <xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:CostField]))"/></stentry>
-                                -->
+                                -\->
                                 
-                                <stentry debug="667" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  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 debug="667a" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:CostField]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:CostField]))"/><!--<xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/>--></stentry>
+                                <stentry debug="667" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  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 debug="667a" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:CostField]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:CostField]))"/><!-\-<xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/>-\-></stentry>
                                 
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                         
                     </strow>
                     <strow props="graph.title" rev="debug - to wchodzi pionowo z gory na dol, unikalne wartosci na Y">
-                        <!--FUNC IS USING THIS $system_cache__dita:graph.title//stentry[contains(@audience,current())] -->
+                        <!-\-FUNC IS USING THIS $system_cache__dita:graph.title//stentry[contains(@audience,current())] -\->
                         <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"/>
-                            <!--<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" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">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="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" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">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>-->
+                            <!-\-<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:for-each-group select="current-group()" group-by="@*[name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber]">
                                 <xsl:sort select="number(@*[name()=$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.{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">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:leadingNumber]}"
+                                <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" group="iloscB.{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">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:leadingNumber]}"
                                      group="kosztB.{@*[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"/>koszt B.<xsl:value-of select="@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType]"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]"/></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:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>koszt B.<xsl:value-of select="@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType]"/>.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]"/></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:leadingNumber ]}" 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:FieldType)}" props="count"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>ilość B.<xsl:value-of select="@*[ name()=$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:leadingNumber ]}" 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:FieldType)}" props="sum"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>koszt B.<xsl:value-of select="@*[ name()=$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:leadingNumber ]}" group="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)}" props="count"><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:leadingNumber ]}" group="wartosc.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)}" props="count"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>Il.<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:leadingNumber ]}" group="daane.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)}" props="sum"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>Wart.<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:leadingNumber ]}" 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:FieldType)}" props="count"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>ilość B.<xsl:value-of select="@*[ name()=$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:leadingNumber ]}" 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:FieldType)}" props="sum"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>koszt B.<xsl:value-of select="@*[ name()=$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:leadingNumber ]}" group="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)}" props="count"><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:leadingNumber ]}" group="wartosc.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)}" props="count"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>Il.<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:leadingNumber ]}" group="daane.{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)}" props="sum"><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>Wart.<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 ]"/>-\->
                                 
                                 
                                 
@@ -144,18 +331,18 @@
                         </xsl:for-each-group>
                     </strow>
                     <strow props="graph.color.name">
-                        <!--FUNC IS USING THIS <xsl:for-each select="current-group()/@current-grouping-key">
-                            <xsl:for-each select="$graph.color.variable//stentry[@current-grouping-key=current()]">-->
+                        <!-\-FUNC IS USING THIS <xsl:for-each select="current-group()/@current-grouping-key">
+                            <xsl:for-each select="$graph.color.variable//stentry[@current-grouping-key=current()]">-\->
                                 
                         <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"/>
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">blue</stentry>-->
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">brown</stentry>-->
+                            <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">blue</stentry>-\->
+                            <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">brown</stentry>-\->
                             <xsl:for-each-group select="current-group()" group-by="@*[name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber]">
                                 <xsl:sort select="number(@*[name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber])" data-type="number" order="ascending"/>
-                                <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  >blue</stentry>-->
-                                <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  >red</stentry>-->
-                                <!--<xsl:choose>
+                                <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  >blue</stentry>-\->
+                                <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  >red</stentry>-\->
+                                <!-\-<xsl:choose>
                                     <xsl:when test="1=2"/>
                                     <xsl:when test="@default_db__x3A__BI_audit_BENFORD:leadingNumber=1">
                                         <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  >#F000FF</stentry></xsl:when>
@@ -182,7 +369,7 @@
                                     <xsl:otherwise>
                                         <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  >#<xsl:value-of select="9-number(@default_db__x3A__BI_audit_BENFORD:leadingNumber)"/>0<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>0<xsl:value-of select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>F</stentry>
                                     </xsl:otherwise>
-                                </xsl:choose>-->
+                                </xsl:choose>-\->
                                 <xsl:choose>
                                     <xsl:when test="1=2"/>
                                     <xsl:when test="@default_db__x3A__BI_audit_BENFORD:leadingNumber=1">
@@ -214,24 +401,24 @@
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
-                    <!--<strow props="graph.color.variable">
+                    <!-\-<strow props="graph.color.variable">
                         <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset//*" group-by="@default_db__x3A__BI_audit_BENFORD:leadingNumber">
                             <stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}">blue</stentry>
                             <stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}">red</stentry>
                         </xsl:for-each-group>
-                    </strow>-->
+                    </strow>-\->
                     <strow props="graph.yaxis">
                         <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"/>
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"/>-->
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">2</stentry>-->
+                            <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"/>-\->
+                            <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">2</stentry>-\->
                             
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">2</stentry>-->
+                            <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">2</stentry>-\->
                             
                             <xsl:for-each-group select="current-group()" group-by="@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]">
                                 <xsl:sort select="number(@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ])" data-type="number" order="ascending"/>
-                                <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  />-->
-                                <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"/>-->
+                                <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  />-\->
+                                <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"/>-\->
                                 <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  />
                                 <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  >2</stentry>
                             </xsl:for-each-group>
@@ -240,25 +427,25 @@
                     <strow props="graph.fill.style">
                         <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"/>
-                            <!--<stentry props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"/>-->
-                            <!--<stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"/>-->
+                            <!-\-<stentry props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"/>-\->
+                            <!-\-<stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"/>-\->
                             
-                            <!--<stentry props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-\- with boxes -\-></stentry>-->
+                            <!-\-<stentry props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-\\- with boxes -\\-></stentry>-\->
                             
                             <xsl:for-each-group select="current-group()" group-by="@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]">
                                 <xsl:sort select="number(@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ])" data-type="number" order="ascending"/>
-                                <!--<stentry props="graph.title.unique"      current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}_{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"  />-->
-                                <!--<stentry props="graph.title.unique"    
-                                    current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  />-->
-                                <stentry props="graph.title" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  /><!-- _{@default_db__x3A__BI_audit_BENFORD:leadingNumber} -->
-                                <stentry props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  ><!-- _{@default_db__x3A__BI_audit_BENFORD:leadingNumber} --><!--with impulses--></stentry>
+                                <!-\-<stentry props="graph.title.unique"      current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}_{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"  />-\->
+                                <!-\-<stentry props="graph.title.unique"    
+                                    current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  />-\->
+                                <stentry props="graph.title" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  /><!-\- _{@default_db__x3A__BI_audit_BENFORD:leadingNumber} -\->
+                                <stentry props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  ><!-\- _{@default_db__x3A__BI_audit_BENFORD:leadingNumber} -\-><!-\-with impulses-\-></stentry>
                                 
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
                     <strow props="graph.newhistogram">
                         
-                        <!--FUNC IS USING THIS <xsl:for-each-group select="$graph.newhistogram//stentry" group-by="text()">
+                        <!-\-FUNC IS USING THIS <xsl:for-each-group select="$graph.newhistogram//stentry" group-by="text()">
                             <xsl:for-each-group select="current-group()"  group-by="@audience" >
                         
                                 <xsl:for-each-group select="$system_cache__dita:graph.title//stentry[contains(@audience,current())]" group-by="text()">
@@ -268,24 +455,24 @@
                                                                             <xsl:copy-of select="@platform"/>
                                                                         </p5gnuplot:current-grouping-key.xtics>
                                                                     </xsl:for-each>
-                        -->
+                        -\->
                         
                         <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"/>
-                            <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu</stentry>-->
+                            <!-\-<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu</stentry>-\->
                             
-                            <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ],'-','\\n')"/></stentry>-->
+                            <!-\-<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ],'-','\\n')"/></stentry>-\->
                             
                             <xsl:for-each-group select="current-group()" group-by="@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]">
                                 <xsl:sort select="number(@*[ name()=$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 ]}"> analiza \n rozkładu <!-\-<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>-\-></stentry>-->
-                                <!-- current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}" -->
-                                <!--<stentry 
+                                <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <!-\\-<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>-\\-></stentry>-\->
+                                <!-\- current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}" -\->
+                                <!-\-<stentry 
                                     current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"
-                                      audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <!-\-<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 ]"/>-->
+                                      audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <!-\\-<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:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ],'-','\\n')"/></stentry><!-- analiza \n rozkładu -->
-                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ],'-','\\n')"/></stentry><!--  analiza \n rozkładu -->
+                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ],'-','\\n')"/></stentry><!-\- analiza \n rozkładu -\->
+                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:leadingNumber ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ],'-','\\n')"/></stentry><!-\-  analiza \n rozkładu -\->
                                 
                             </xsl:for-each-group>
                         </xsl:for-each-group>
@@ -300,10 +487,10 @@
         </xsl:variable>
         <xsl:choose>
             <xsl:when test="$simpletable//stentry">
-                <!--<xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows">
+                <!-\-<xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows">
                     <xsl:with-param name="simpletable" select="$simpletable"/>
                     <xsl:with-param name="title"> (APU4-DT) umowy obiektu tabela </xsl:with-param>
-                </xsl:call-template>-->
+                </xsl:call-template>-\->
                 <xsl:choose>
                     <xsl:when test="count($simpletable/simpletable//stentry) &gt; $system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max">
                         <p props="count_444">wielkość zbioru <xsl:value-of select="count($simpletable/simpletable//stentry)"/> - pominięto wyświetlanie tabeli</p>
@@ -322,17 +509,17 @@
                             <xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
                                 <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
                             </xsl:call-template>
-                <!--<p> (<xsl:value-of select="$graph.name"/>) umowy obiektu wykres </p>-->
+                <!-\-<p> (<xsl:value-of select="$graph.name"/>) umowy obiektu wykres </p>-\->
                 <foreign rev="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl#738">
                     <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>
                 <foreign rev="SIMPLETABLE_WTITLE #749">
@@ -351,7 +538,7 @@
                     Brak danych kontekstowych  
                 </ph>
             </xsl:otherwise>
-        </xsl:choose>
+        </xsl:choose>-->
     </xsl:template>
     
     
@@ -360,232 +547,148 @@
     
     <xsl:template name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values" >
         <xsl:param name="fid" select="@fid"/>
-        <xsl:param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" required="yes"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" 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><!-- TODO? chyba do benforda z liczba wiodaca -->
         <xsl:param name="graph.name" select="'APU4-DKW'"/>
         
-        <!--<strow>
-            <xsl:copy-of select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset"/>
-        </strow>-->
-        <xsl:variable name="SIMPLETABLE_WTITLE">
-            <SIMPLETABLE_WTITLE>
-                <simpletable frame="all"
-                    rev="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl#756"
-                    props="graph.ylabel.ilosc  no.logscale.y1 graph.y2label.wartosc   graph.style.histogram font15"><!-- id="ANALIZA_UMOW_4UA.graph.deals.values_table_2_5_{$generate_id}_{$title}" --><!-- no.logscale.y2 graph.y2label.wartosc --><!-- graph.style.histogram --><!-- font15 --><!-- print__no  -->
-                    <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"/>
-                        <xsl:with-param name="title" select="$title"/>
-                    </xsl:call-template>
-                    <strow props="graph.headers">
-                        <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.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 ]}"><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 ]}"><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>    
-                            <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>-->
-                        </xsl:for-each-group>
-                    </strow>
-                    <strow props="graph.data" rev="generate-id={@generate-id}">
-                        <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"/>
-                            <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="count(current-group())"/></stentry>-->
-                            <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/></stentry>-->
-                            <xsl:variable name="current-group.parent.count" select="count(current-group())"/>
-                            <!--<xsl:for-each-group select="current-group()" group-by="@default_db__x3A__BI_audit_BENFORD:leadingNumber">-->
-                            <!--<xsl:sort select="number(@default_db__x3A__BI_audit_BENFORD:leadingNumber)" data-type="number" order="ascending"/>-->
-                            <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:value-of select="count(current-group())"/></stentry>
-                            <stentry debug="773"  current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]))"/></stentry>
-                            <!--</xsl:for-each-group>-->
-                        </xsl:for-each-group>
-                        
-                    </strow>
-                    
-                    <xsl:call-template name="p5gnuplot:simpletable__x3A__graph.stats">
-                        <xsl:with-param name="system_cache__dita:context.path.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>
-                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
-                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/><!-- $default_db__x3A__BI_audit_BENFORD:FieldType -->
-                        <xsl:with-param name="audience">rozklad</xsl:with-param>
-                        <!--<xsl:with-param name="group.root">koszt.</xsl:with-param>-->
-                        <xsl:with-param name="group.count">iloscB.</xsl:with-param>
-                        <xsl:with-param name="group.sum">kosztB.</xsl:with-param>
-                    </xsl:call-template>
-                    
-                    
-                    
-                    <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"/>
-                            <!--<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" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">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="ilosc {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">ilość U.<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="koszt {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">koszt U.<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]"/></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>
-                    <strow props="graph.color.name">
-                        <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"/>
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">blue</stentry>-->
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">brown</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 ]}">blue</stentry>
-                            <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">red</stentry>
-                            
-                            
-                            <!--</xsl:for-each-group>-->
-                        </xsl:for-each-group>
-                    </strow>
-                    <!--<strow props="graph.color.variable">
-                        <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset//*" group-by="@default_db__x3A__BI_audit_BENFORD:leadingNumber">
-                            <stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}">blue</stentry>
-                            <stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}">red</stentry>
-                        </xsl:for-each-group>
-                    </strow>-->
-                    <strow props="graph.yaxis">
-                        <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.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 ]}"/>-->
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">2</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 ]}"/>
-                            <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">2</stentry>
-                            <!--</xsl:for-each-group>-->
-                        </xsl:for-each-group>
-                    </strow>
-                    <strow props="graph.fill.style">
-                        <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.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 props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"/>-->
-                            <!--<stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"/>-->
-                            <!--<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 props="graph.title.unique"      current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  />
-                            <stentry props="graph.title.unique"      current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  />
-                            <!--</xsl:for-each-group>-->
-                        </xsl:for-each-group>
-                    </strow>
-                    <strow props="graph.newhistogram">
-                        <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.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 audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu</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 ]}"> analiza \n kosztu <xsl:value-of select="$graph.name"/> <!--<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 ]}"> analiza \n kosztu <xsl:value-of select="$graph.name"/> <!--<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>-->
-                        </xsl:for-each-group>
-                    </strow>
-                </simpletable>
-            </SIMPLETABLE_WTITLE>
-        </xsl:variable>
-        <xsl:variable name="simpletable">
-            <xsl:call-template name="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable">
-                <xsl:with-param name="simpletable" select="$SIMPLETABLE_WTITLE"/>
-            </xsl:call-template>
-        </xsl:variable>
-        <xsl:choose>
-            <xsl:when test="$simpletable//stentry">
-                
-                
-                
-                
-                
-                
-                <!--<xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows">
-                    <xsl:with-param name="simpletable" select="$simpletable"/>
-                    <xsl:with-param name="title"> (APU4-DT) umowy obiektu tabela </xsl:with-param>
-                </xsl:call-template>-->
+        <simpletable props="nograph #557 n/={name()}  /n={$graph.name}" id="{@fid}_557">
+            <xsl:variable name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead">
+                <sthead >
+                <xsl:call-template name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead"   >
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable"/>
+                </xsl:call-template>    
+            </sthead>
+            </xsl:variable>
+            <xsl:copy-of select="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead"></xsl:copy-of>
+            
+            <xsl:apply-templates mode="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values"  select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable">
+                <xsl:with-param name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead" select="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead" tunnel="yes"/>
+            </xsl:apply-templates>
+           <!-- <strow>
+                <stentry>test</stentry>
+            </strow>
+            <strow>
+                <stentry>test2</stentry>
+            </strow>-->
+        </simpletable>
+        <!--<foreign props="#565 copy">
+            
+        </foreign>-->
+        
+        
+    </xsl:template>
+    
+    <xsl:template match="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.attrs__x3A__to_nodeset" mode="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values">
+        <xsl:apply-templates mode="#current"/>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead" >
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" required="yes"/>
+        <xsl:for-each-group select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable/descendant-or-self::*[@*[contains(name(),'default_db__x3A__BI_audit_BENFORD:CostField') ] and not(*) ]" group-by="local-name()">
+            <xsl:variable name="system_cache__dita:localname.translate" >
+                <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@*[contains(name(),'default_db__x3A__BI_audit_BENFORD:CostField') ]"/>
+            </xsl:variable>
+            <stentry  rev="default_db__x3A__BI_audit_BENFORD:CostField">
                 <xsl:choose>
-                    <xsl:when test="count($simpletable/simpletable//stentry) &gt; $system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max">
-                        <p props="count_444">wielkość zbioru <xsl:value-of select="count($simpletable/simpletable//stentry)"/> - pominięto wyświetlanie tabeli</p>
+                    <xsl:when test="string-length($system_cache__dita:localname.translate) &gt;0">
+                        <xsl:value-of select="$system_cache__dita:localname.translate"/>
                     </xsl:when>
                     <xsl:otherwise>
-                        <!--<foreign rev="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl#727">
-                                    <xsl:copy-of select="$simpletable/simpletable/*"/>
-                                </foreign>-->
-                        <!--<xsl:apply-templates mode="p5gnuplot:simpletable__x3A__from_rows" select="$simpletable">
-                                    <xsl:with-param name="title" select="'APU4-DKT'"/>
-                                    <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
-                                </xsl:apply-templates>-->
+                        <xsl:value-of select="replace(local-name(),'_',' ')"/>
                     </xsl:otherwise>
                 </xsl:choose>
-                <xsl:comment>BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl#651</xsl:comment>
-                <!--<xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
-                            <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
-                        </xsl:call-template>-->
-                <!--<p> (<xsl:value-of select="$graph.name"/>) umowy obiektu wykres </p>-->
-                
-                <!--<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:with-param name="simpletable" select="$simpletable"/>
-                    <xsl:with-param name="title"> (APU4-DT) umowy obiektu tabela </xsl:with-param>
-                </xsl:call-template>-->
-                <!--<p>-->
-                <!-- 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="fileindex" select="$simpletable/simpletable/@id"/>
-                </xsl:apply-templates>-->
-                <!--</p>-->
-                <!--<p>--> (<xsl:value-of select="$graph.name"/>) umowy koszty obiektu wykres <!--</p>-->
-                <foreign>
-                    <xsl:copy-of select="$simpletable" copy-namespaces="no"/>
-                </foreign>
-                <!--<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="450"/>
-                    <xsl:with-param name="path.prefix">../</xsl:with-param>
-                </xsl:apply-templates>
-                <!--</p>-->
-                <!-- ANALIZA WYKRESOW -->
-                <!--<xsl:choose>
-                        <xsl:when test="count($simpletable/simpletable//stentry) &gt; $system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max">
-                            <p props="count_166">wielkość zbioru <xsl:value-of select="count($simpletable/simpletable//stentry)"/> - pominięto wyświetlanie tabeli</p>
+            </stentry>
+        </xsl:for-each-group>
+        <xsl:for-each-group select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable/descendant-or-self::*[@*[ contains(name(),'default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month')] and not(*) ]" group-by="local-name()">
+            <xsl:variable name="system_cache__dita:localname.translate" >
+                <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@*[ contains(name(),'default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month')]"/>
+            </xsl:variable>
+            <stentry  rev="default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month"><!-- props="{current-grouping-key()}" -->
+                <xsl:choose>
+                    <xsl:when test="string-length($system_cache__dita:localname.translate) &gt;0">
+                        <xsl:value-of select="$system_cache__dita:localname.translate"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:value-of select="replace(local-name(),'_',' ')"/>
+                    </xsl:otherwise>
+                </xsl:choose>
+            </stentry>
+        </xsl:for-each-group>
+        
+        <xsl:for-each-group select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable/descendant-or-self::*[@*[contains(name(),'default_db__x3A__BI_audit_BENFORD:CostSubjectFields.')] and not(*) ]" group-by="local-name()">
+            <xsl:variable name="system_cache__dita:localname.translate" >
+                <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@*[contains(name(),'default_db__x3A__BI_audit_BENFORD:CostSubjectFields.')]"/>
+            </xsl:variable>
+            <stentry props="{current-grouping-key()}" >
+                <xsl:choose>
+                    <xsl:when test="string-length($system_cache__dita:localname.translate) &gt;0">
+                        <xsl:value-of select="$system_cache__dita:localname.translate"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:value-of select="replace(local-name(),'_',' ')"/>
+                    </xsl:otherwise>
+                </xsl:choose>
+            </stentry>
+        </xsl:for-each-group>
+        
+        
+        
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values" match="*">
+        <xsl:param name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead" tunnel="yes" required="yes"/>
+        <xsl:variable name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context" select="."/>
+        <xsl:variable name="matched.candidate">
+            <strow>
+                <xsl:for-each select="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead//stentry">
+                    
+                    <xsl:choose>
+                        <xsl:when test="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/*[ local-name()=current()/@props and not(*) ]">
+                            <stentry props="{$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/@generate-id} n/{$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/name()}" rev="matched.candidate">
+                                <xsl:value-of select="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/*[ local-name()=current()/@props]"/>
+                            </stentry>
                         </xsl:when>
+                        <!--<xsl:when test="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/*[ @*[name()=current()/@rev] and not(*) ]">
+                            <stentry props="{$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/@generate-id} #650 n/{$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/name()} {@rev}" rev="matched.candidate" >
+                                <xsl:value-of select="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/*[ @*[name()=current()/@rev] and not(*) ]/@*[name()=current()/@rev]"/>
+                            </stentry>
+                        </xsl:when>-->
                         <xsl:otherwise>
-                    
+                            <stentry props="no {$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/@generate-id}  n/{$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/name()} @props={@props} @rev={@rev}" rev="matched.candidate.not">
+                                <!--<xsl:copy-of select="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/@*"></xsl:copy-of>-->
+                                <xsl:value-of select="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/local-name()"/>
+                            </stentry>
                         </xsl:otherwise>
-                    </xsl:choose>-->
-                <xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__analyze">
-                    <xsl:with-param name="fileindex" select="$simpletable/simpletable/@id"/>
-                </xsl:call-template>
+                    </xsl:choose>
+                    <xsl:choose>
+                        <xsl:when test="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/*[ @*[name()=current()/@rev] and not(*) ]">
+                            <stentry props="{$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/@generate-id} gen={generate-id($system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context)} #650 n/{$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/name()} {@rev}" rev="matched.candidate" >
+                                <xsl:value-of select="$system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.context/*[ @*[name()=current()/@rev] and not(*) ]/@*[name()=current()/@rev]"/>
+                            </stentry>
+                        </xsl:when>
+                    </xsl:choose>
+                </xsl:for-each>
+            </strow>
+        </xsl:variable>
+        <xsl:choose>
+            <xsl:when test="$matched.candidate//stentry[@rev='matched.candidate']">
+                <strow>
+                <xsl:copy-of select="$matched.candidate//stentry[@rev='matched.candidate']"/>
+                </strow>
             </xsl:when>
             <xsl:otherwise>
-                <!--<p props="214a">
-                </p>-->
+                <!--<xsl:copy-of select="$matched.candidate"/>-->
+                <!--<xsl:comment>#628 BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.graph.deals.xsl @rev='matched.candidate.not' </xsl:comment>-->
             </xsl:otherwise>
         </xsl:choose>
     </xsl:template>
     
+    <xsl:template mode="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values" match="text()|comment()"/>
+    
+    <xsl:template mode="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead" match="*"/>
+    
+    <xsl:template mode="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values.sthead" match="text()|comment()"/>
+    
 </xsl:stylesheet>

+ 278 - 94
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.graph.related.xsl

@@ -49,68 +49,247 @@
         
         
         <xsl:variable name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new.config">
+            <xsl:variable name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="'default_db__x3A__BI_audit_BENFORD:leadingTimeYear'"/><!-- $default_db__x3A__BI_audit_BENFORD:FieldType -->
+            <xsl:variable name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"/>
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/><!--'default_db__x3A__BI_audit_BENFORD:leadingTimeYear' $default_db__x3A__BI_audit_BENFORD:FieldType default_db__x3A__BI_audit_BENFORD:leadingTimeYear-quarter --><!-- 'default_db__x3A__BI_audit_BENFORD:leadingTimeYear' $default_db__x3A__BI_audit_BENFORD:leadingNumber  -->
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience" select="'rozklad_'"/>
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root" select="'koszt.'"/>
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count" select="'iloscB.'"/>
+            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum" select="'kosztB.'"/>
             <system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new>
                 <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="concat($graph.name,'_GEN')"/>
+                    <!--<xsl:with-param name="graph.name" select="concat($graph.name,'_GEN')"/>-->
+                    <xsl:with-param name="graph.name" select="$graph.name"/>
                     <xsl:with-param name="title" select="$title"/>
                 </xsl:call-template>
-                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props.nograph"/>.
+                <!--<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props.nograph"/>-->
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:font">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:font9" select="true()"/>
+                </xsl:call-template>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:graph.ylabel">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.ylabel">Y</xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:graph.y2label">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.y2label">wartosc</xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:graph.style">
+                    <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.style.histogram" select="true()"/>-->
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.style.histogram.rowstacked" select="true()"/>
+                </xsl:call-template>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:no.logscale.y1"/>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:no.logscale.y2"/>
+                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:graph.separate.outputs.auto"/>
+                
                 <system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new>
-                    <system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root>
+                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.stats">
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum"/>
+                    </xsl:call-template>
+                    <system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root debug.row="60">
                         <!-- jakim modem ma modul wyrzic spowrotem - z listy -->
                         <!--<xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child_flag" />--><!-- czy podwojnie robic w dol -->
-                        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order" select="'ascending'"/>
-                        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute.name" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type" select="'number'"/>
-                        <system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root>
-                            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.fallback.mode" select="'system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new'"/>
-                            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute" select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"/>
-                            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order" select="'ascending'"/>
-                            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute.name" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type" select="'number'"/>
-                            
-                            <system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new>
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/><!--  col="1">2013|3</sten -->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/><!-- w @props="graph.stats" jest inaczej   props="group.sum" current-grouping-key="100000.0" audience="rozklad_100000.0" group="kosztB.2013|3"-->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-- no more foud -->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-- current-grouping-key="2013|3" -->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-- only title current-grouping-key="2013|3" group="koszt 2013|3" audience="rozklad_2013|3" col="2">koszt U.100000.0 -->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc" />
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.title.string.uniq.desc"/>
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.title.text.uniq.desc"/><!-- group="ilosc 2013|3" audience="rozklad_2013|3" col="1">ilość U.2013|3</stent -->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.title.time.uniq.desc" /><!-- blad?  koszt U.100000.0; ilość U.2014|1;koszt U.1000000.0  -->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.color.name.text" /><!-- todo options blue,red -->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int" /><!-- col="2">2</ste -->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc" /><!-- todo options -->
-                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.newhistogram.string.uniq.desc" />
-                            </system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new>
-                        </system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root>
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.interface.for-each-group.child">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type">number</xsl:with-param>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order">ascending</xsl:with-param>
+                        </xsl:call-template>
+                            <!--<system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new debug.row="75">
+                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-\-  col="1">2013|3</sten -\->
+                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc">rozklad_</xsl:attribute><!-\- w @props="graph.stats" jest inaczej   props="group.sum" current-grouping-key="100000.0" audience="rozklad_100000.0" group="kosztB.2013|3"-\->
+                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-\- no more foud -\->
+                                
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.platform"><!-\- todo ? do grupowania?  -\->
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute" select="system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)"/>
+                                </xsl:call-template>
+                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-\- current-grouping-key="2013|3" -\->
+                                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-\- only title current-grouping-key="2013|3" group="koszt 2013|3" audience="rozklad_2013|3" col="2">koszt U.100000.0 -\->
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.group">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root"/>
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"/>
+                                </xsl:call-template>
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.value.sum">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                </xsl:call-template>
+                                <!-\-<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.color">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr" select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"/>
+                                </xsl:call-template>-\->
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.yaxis">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int" select="2"/>
+                                </xsl:call-template>
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.fill.style">
+                                    <!-\-<xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc" select="2"/>-\-><!-\-with impulses-\->
+                                    <!-\-<xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.title" select="true()"/>-\->
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle" select="true()"/>
+                                </xsl:call-template>
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.newhistogram">                                    
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/><!-\-rozklad_</xsl:with-param>-\->
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                    
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc" >analiza \n rozkładu </xsl:with-param>
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc"/>
+                                </xsl:call-template>                                
+                            </system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new>-->
+                            <system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root debug.row="68">
+                                <!--<xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.fallback.mode" select="'system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new'"/>-->
+                                
+                                <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.interface.for-each-group.child">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.current-group" select="true()"/>
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type">number</xsl:with-param>
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order">ascending</xsl:with-param>
+                                </xsl:call-template>
+                                
+                               
+                                <!--<system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new debug.row="94">
+                                    <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-\-  col="1">2013|3</sten -\->
+                                    <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/><!-\-rozklad_</xsl:attribute>-\-><!-\- w @props="graph.stats" jest inaczej   props="group.sum" current-grouping-key="100000.0" audience="rozklad_100000.0" group="kosztB.2013|3"-\->
+                                    
+                                    <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-\- no more foud -\->
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.platform"><!-\- todo ? do grupowania?  -\->
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute" select="system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)"/>
+                                    </xsl:call-template>
+                                    
+                                    <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-\- current-grouping-key="2013|3" -\->
+                                    <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/><!-\- only title current-grouping-key="2013|3" group="koszt 2013|3" audience="rozklad_2013|3" col="2">koszt U.100000.0 -\->
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.group">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count"/>
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"/>
+                                    </xsl:call-template>
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.value.sum">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.count" select="true()"/>
+                                    </xsl:call-template>
+                                    
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.color">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr" select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"/>
+                                    </xsl:call-template>
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.yaxis">
+                                        <!-\-<xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int" select="2"/>-\->
+                                    </xsl:call-template>
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.fill.style">
+                                        <!-\-<xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc" select="2"/>-\-><!-\-with impulses-\->
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.title" select="true()"/>
+                                        <!-\-<xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle" select="true()"/>-\->
+                                    </xsl:call-template>
+                                    
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.newhistogram">                                    
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/><!-\-rozklad_</xsl:with-param>-\->
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                        
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc" >analiza \n rozkładu </xsl:with-param>
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc"/>
+                                    </xsl:call-template>
+                                </system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new>-->
+                                <system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new debug.row="94">
+                                    
+                                    <!--rozklad_</xsl:attribute>--><!-- w @props="graph.stats" jest inaczej   props="group.sum" current-grouping-key="100000.0" audience="rozklad_100000.0" group="kosztB.2013|3"-->
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.header">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/><!-- $default_db__x3A__BI_audit_BENFORD:FieldType --><!--  col="1">2013|3</sten -->
+                                        <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>-->
+                                    </xsl:call-template>
+                                    
+                                    
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.audience">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/>
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+                                        <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>-->
+                                    </xsl:call-template>
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.platform"><!-- todo ? do grupowania?  -->
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute" select="system_cache__dita:platform__x3A__escape($default_db__x3A__BI_audit_BENFORD:FieldType)"/>
+                                    </xsl:call-template>
+                                    
+                                    <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/><!-- current-grouping-key="2013|3" -->
+                                    
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.group"><!-- only title current-grouping-key="2013|3" group="koszt 2013|3" audience="rozklad_2013|3" col="2">koszt U.100000.0 -->
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum"/>
+                                        <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>--><!-- $default_db__x3A__BI_audit_BENFORD:leadingNumber -->
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>
+                                    </xsl:call-template>
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.value.sum">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                    </xsl:call-template>
+                                    <!--<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.color">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr" select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"/>
+                                    </xsl:call-template>-->
+                                    <!--<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.yaxis">
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int" select="2"/>
+                                    </xsl:call-template>-->
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.fill.style">
+                                        <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc" select="2"/>--><!--with impulses-->
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.title" select="true()"/>
+                                        <!--<xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle" select="true()"/>-->
+                                    </xsl:call-template>
+                                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:set.graph.newhistogram">                                    
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/><!--rozklad_</xsl:with-param>-->
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/><!-- $p5gnuplot:simpletable__x3A__graph.stats.group_by -->
+                                        
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc" >k. </xsl:with-param>
+                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc"/>
+                                    </xsl:call-template>
+                                </system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new>
+                            </system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root>
                     </system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root>
                 </system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new>
             </system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new>
         </xsl:variable>
         
-        <ph rev="579 debug system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root">
-            <ph rev="$default_db__x3A__BI_audit_BENFORD:leadingNumber">
+        
+            <!--<ph rev="$default_db__x3A__BI_audit_BENFORD:leadingNumber">
                 <xsl:copy-of select="$default_db__x3A__BI_audit_BENFORD:leadingNumber"></xsl:copy-of>
-            </ph>
+            </ph>-->
             <!--<xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml"></xsl:copy-of>-->
+            <xsl:variable name="SIMPLETABLE_WTITLE">
+                <SIMPLETABLE_WTITLE>
+                    <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root" select="$system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new.config">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.related.childs.attrs.nodeset/*/*" tunnel="yes"/>
+                        <!--<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" tunnel="yes"/>-->
+                    </xsl:apply-templates>
+                </SIMPLETABLE_WTITLE>
+            </xsl:variable>
+            <xsl:variable name="simpletable">
+                <xsl:call-template name="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable">
+                    <xsl:with-param name="simpletable" select="$SIMPLETABLE_WTITLE"/>
+                </xsl:call-template>
+            </xsl:variable>
             
-            <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root" select="$system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new.config">
-                <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.related.childs.attrs.nodeset/*/*" tunnel="yes"/>
-            </xsl:apply-templates>
-        </ph>
         
+        <xsl:choose>
+            <xsl:when test="$simpletable//stentry">
+                <foreign rev="579 debug system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root">
+                    <xsl:copy-of select="$simpletable" />
+                </foreign>
+                
+                <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>
+                
+            </xsl:when>
+        </xsl:choose>
+        
+        
+        
+        <!--  --><!--  --><!--  --><!--  -->
+        
+
+        <!--MERGED_BEGIN
         
         <xsl:variable name="SIMPLETABLE_WTITLE">
             <SIMPLETABLE_WTITLE>
                 <simpletable frame="all"
                     
-                    props="graph.ylabel.Y graph.y2label.wartosc graph.style.histogram graph.style.histogram  no.logscale.y1 no.logscale.y2 font15 graph.separate.outputs.auto  {$default_db__x3A__BI_audit_BENFORD:ValueType}"><!-- --><!-- print__no 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  {$default_db__x3A__BI_audit_BENFORD:ValueType}"><!-\- -\-><!-\- 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"/>
@@ -121,15 +300,20 @@
                         <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 debug="#977 generate-id={@generate-id}" 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)}xxx"><!--<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>
+                            <!-\- debug="#977 generate-id={@generate-id}" -\->
+                            <stentry   props="graph.xtic" 
+                                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 ]}"><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 debug="953 generate-id={@generate-id}" 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)}xxx"><xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>
-                                <stentry debug="954 generate-id={@generate-id}" 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)}xxx"><xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>
+                                <xsl:sort select="number(@default_db__x3A__BI_audit_BENFORD:leadingNumber)" data-type="number" order="ascending"/><!-\- debug="953 generate-id={@generate-id}" -\->
+                                <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)}"><!-\- debug="954 generate-id={@generate-id}" -\-><xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
@@ -137,11 +321,11 @@
                     <strow props="graph.data">
                         <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 audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="count(current-group())"/></stentry>-->
+                            <!-\-<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="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:attribute name="debug.964" select="current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]"/>
+                            <stentry  current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">
+                                <!-\-<xsl:attribute name="debug.964" select="current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]"/>
                                 <xsl:attribute name="debug.965" select="current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]"/>
                                 <xsl:attribute name="debug.group" select="current-grouping-key()"/>
                                 <xsl:attribute name="debug.current-group.parent.count" select="$current-group.parent.count"/>
@@ -163,26 +347,22 @@
                                     <xsl:for-each select="current-group()/*/@default_db__x3A__BI_audit_BENFORD:CostField">
                                         <xsl:value-of select="."/>",<xsl:text> </xsl:text>
                                     </xsl:for-each>
-                                </xsl:attribute>
-                                <!--<xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>--><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]))"/><!--<xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/>--></stentry>
+                                </xsl:attribute>-\->
+                                <!-\-<xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>-\-><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]))"/><!-\-<xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/>-\-></stentry>
                             <xsl:for-each-group select="current-group()" group-by="@default_db__x3A__BI_audit_BENFORD:leadingNumber">
                                 <xsl:sort select="number(@default_db__x3A__BI_audit_BENFORD:leadingNumber)" data-type="number" order="ascending"/>
-                                <stentry debug="992" 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 debug="993" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]))"/><!--<xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/>--></stentry>
+                                <stentry  current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><xsl:value-of select="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()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number(@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]))"/><!-\-<xsl:value-of select="sum(current-group()/*[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]]/number())"/>-\-></stentry>
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
                     
                     <xsl:call-template name="p5gnuplot:simpletable__x3A__graph.stats">
-                        <xsl:with-param name="system_cache__dita:context.path.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.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="system_cache__dita:context.path.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.related.childs.attrs.nodeset"/>                        
+                        <!-\- <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
                         <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>-->
-                        
-                        
+                        <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>-\->
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
                         <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
@@ -197,12 +377,12 @@
                         <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:leadingNumber' ]}" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape('default_db__x3A__BI_audit_BENFORD:leadingNumber')}xxx" 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:leadingNumber' ]"/></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="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:leadingNumber' ]}" 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:leadingNumber' ]"/></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:leadingNumber' ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape('default_db__x3A__BI_audit_BENFORD:leadingNumber')}xxx" props="count"><!--<xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>-->ilość B.<xsl:value-of select="@*[ name()='default_db__x3A__BI_audit_BENFORD:leadingNumber' ]"/></stentry><!--<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>--><!--<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:leadingNumber' ]}" audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" platform="{system_cache__dita:platform__x3A__escape('default_db__x3A__BI_audit_BENFORD:leadingNumber')}xxx" props="sum"><!--<xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>-->koszt B.<xsl:value-of select="@*[ name()='default_db__x3A__BI_audit_BENFORD:leadingNumber' ]"/></stentry><!-- <xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/> --><!--<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:leadingNumber' ]}"  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="@*[ name()='default_db__x3A__BI_audit_BENFORD:leadingNumber' ]"/></stentry><!-\-<xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/>-\-><!-\-<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:leadingNumber' ]}" 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="@*[ name()='default_db__x3A__BI_audit_BENFORD:leadingNumber' ]"/></stentry><!-\- <xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/> -\-><!-\-<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>
@@ -210,8 +390,8 @@
                         <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 ]}">blue</stentry>-->
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">brown</stentry>-->
+                            <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">blue</stentry>-\->
+                            <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">brown</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"/>
                                 <xsl:choose>
@@ -243,22 +423,22 @@
                                     </xsl:otherwise>
                                 </xsl:choose>
                                 
-                                <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  >red</stentry>-->
+                                <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  >red</stentry>-\->
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
-                    <!--<strow props="graph.color.variable">
+                    <!-\-<strow props="graph.color.variable">
                         <xsl:for-each-group select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.related.childs.attrs.nodeset//*" group-by="@default_db__x3A__BI_audit_BENFORD:leadingNumber">
                             <stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}">blue</stentry>
                             <stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}">red</stentry>
                         </xsl:for-each-group>
-                    </strow>-->
+                    </strow>-\->
                     <strow props="graph.yaxis">
                         <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 ]}">2</stentry>
-                            <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">2</stentry>-->
+                            <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">2</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 ]}"  />
@@ -269,12 +449,12 @@
                     <strow props="graph.fill.style">
                         <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 props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-- with boxes --></stentry>
-                            <!--<stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"/>-->
+                            <stentry props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-\- with boxes -\-></stentry>
+                            <!-\-<stentry current-grouping-key="{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"/>-\->
                             <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"/>
-                                <!-- graph.title.unique --> <stentry props="graph.title" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}_{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"  />
-                                <stentry props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}_{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"  ><!--with impulses--></stentry>
+                                <!-\- graph.title.unique -\-> <stentry props="graph.title" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}_{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"  />
+                                <stentry props="graph.notitle" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}_{@default_db__x3A__BI_audit_BENFORD:leadingNumber}"  ><!-\-with impulses-\-></stentry>
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
@@ -284,9 +464,9 @@
                             <stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()='default_db__x3A__BI_audit_BENFORD:leadingNumber' ],'-','\\n')"/></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 ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()='default_db__x3A__BI_audit_BENFORD:leadingNumber' ],'-','\\n')"/></stentry><!-- analiza \n rozkładu -->
-                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()='default_db__x3A__BI_audit_BENFORD:leadingNumber' ],'-','\\n')"/></stentry><!--  analiza \n rozkładu -->
-                                <!--<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">an. <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 ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()='default_db__x3A__BI_audit_BENFORD:leadingNumber' ],'-','\\n')"/></stentry><!-\- analiza \n rozkładu -\->
+                                <stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"> analiza \n rozkładu <xsl:value-of select="replace(@*[ name()='default_db__x3A__BI_audit_BENFORD:leadingNumber' ],'-','\\n')"/></stentry><!-\-  analiza \n rozkładu -\->
+                                <!-\-<stentry current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"  audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">an. <xsl:value-of select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]"/></stentry>-\->
                             </xsl:for-each-group>
                         </xsl:for-each-group>
                     </strow>
@@ -298,49 +478,53 @@
                 <xsl:with-param name="simpletable" select="$SIMPLETABLE_WTITLE"/>
             </xsl:call-template>
         </xsl:variable>
+        
         <xsl:choose>
             <xsl:when test="$simpletable//stentry">
-                <!--<xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows">
+                <!-\-<xsl:call-template name="p5gnuplot:simpletable__x3A__from_rows">
                     <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: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: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 pośrednio powiązane z obiektem<!--</p>--> 
-                <!--<xsl:if test="$mode='system_cache__dita:ANALIZA_UMOW_4UA_preprocess'">-->
+                </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: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">
+                <!-\-</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:choose>
+                </xsl:call-template>-\->
+                <!-\-<xsl:choose>
                     <xsl:when test="count($simpletable/simpletable//stentry) &gt;$system_cache__dita:ANALIZA_UMOW_4UA_preprocess__x3A__table_max">
                         <p props="count_166">wielkość zbioru <xsl:value-of select="count($simpletable/simpletable//stentry)"/> - pominięto wyświetlanie tabeli</p>
                     </xsl:when>
                     <xsl:otherwise>
                         
                     </xsl:otherwise>
-                </xsl:choose>-->
+                </xsl:choose>-\->
                 
                 
             </xsl:when>
             <xsl:otherwise>
-                <!--<p props="214a">
-                </p>-->
+                <!-\-<p props="214a">
+                </p>-\->
             </xsl:otherwise>
         </xsl:choose>
+        
+        MERGED_END-->
+        
     </xsl:template>
     
 </xsl:stylesheet>

+ 11 - 6
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_4UA.xsl

@@ -90,7 +90,7 @@
         <xsl:call-template name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values">
             <xsl:with-param name="fid" select="@fid"/>          
             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="'default_db__x3A__BI_audit_BENFORD:CostField'"/>
-            <xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>
+            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>
             <xsl:with-param name="title" select="$title"/>
         </xsl:call-template>
         <xsl:call-template name="system_cache__dita:ANALIZA_UMOW_4UA.graph.related">
@@ -188,7 +188,9 @@
                         <xsl:result-document href="{system_cache__dita:files.key.href.write.topic.title.context(current(),$title)}.context.path.childs.attrs.nodeset.xml">
                             <xsl:copy-of select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"></xsl:copy-of>
                         </xsl:result-document>
-                        
+                        <xsl:result-document href="{system_cache__dita:files.key.href.write.topic.title.context(current(),$title)}.context.path.values.fixed.current.xml">
+                            <xsl:copy-of select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current"/>
+                        </xsl:result-document>
                         
                         <!--<TEST beg_attrs="{$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}"  cntcg="{count(current-group())}">
                             <xsl:copy-of select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs.nodeset"/>
@@ -239,7 +241,10 @@
                                     
                                 
                                         
-                                <xsl:comment>#2299</xsl:comment>
+                                <xsl:comment>#2299 
+                                $system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.end.attrs
+                                                                    
+                                </xsl:comment>
                                 
                                  
                                 <xsl:choose>
@@ -251,8 +256,8 @@
                                             <xsl:with-param name="system_cache__dita:element__x3A__surrounding">xref</xsl:with-param>
                                         </xsl:call-template>
                                         <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
-                                            <xsl:with-param name="end_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.end.attrs"/>
-                                            <xsl:with-param name="fid" select="@fid"/>
+                                            <xsl:with-param name="fid" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs"/>
+                                            <xsl:with-param name="end_fid" select="$system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed.current/@fid"/><!-- @default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.begin.attrs @fid -->
                                             <xsl:with-param name="link__x3A__title"> do APT </xsl:with-param>
                                             <xsl:with-param name="system_cache__dita:element__x3A__surrounding">xref</xsl:with-param>
                                         </xsl:call-template>
@@ -323,7 +328,7 @@
                                     <p props="analiza_306 system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values">
                                         <xsl:call-template name="system_cache__dita:ANALIZA_UMOW_4UA.graph.deals.values">
                                             <xsl:with-param name="fid" select="@fid"/>                                                                           
-                                            <xsl:with-param name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>
+                                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset"/>
                                             <xsl:with-param name="title" select="$title"/>
                                             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="'default_db__x3A__BI_audit_BENFORD:CostField'"/>
                                         </xsl:call-template>

+ 13 - 2
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

@@ -282,7 +282,16 @@
         <xsl:param name="get_wfs:name_from_fid"/>
         
         
-        <xsl:variable name="end_fid" select="tokenize($end_fid,' ')[1]"/>
+        <xsl:variable name="end_fid" >
+            <xsl:choose>
+                <xsl:when test="string-length(tokenize($end_fid,' ')[1]) &gt; 0">
+                    <xsl:value-of select="tokenize($end_fid,' ')[1]"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="$end_fid"/>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
         
         <xsl:choose>
             <xsl:when test="string-length($fid)&gt;0">
@@ -290,6 +299,7 @@
                     <xsl:variable name="fid" select="current()"/>
                     <!--<xsl:if test="$link__x3A__title"><xsl:element name="{$system_cache__dita:element__x3A__surrounding.title}"><xsl:copy-of select="$link__x3A__title"/></xsl:element></xsl:if>-->
                     <xsl:element name="{$system_cache__dita:element__x3A__surrounding}">
+                        <xsl:attribute name="rev">#deb 293 $fid=<xsl:value-of select="$fid"/>; $end_fid=<xsl:value-of select="$end_fid"/>;</xsl:attribute>
                         <xsl:choose>
                             <xsl:when test="string-length($end_fid)&gt;0">
                                 <xsl:attribute name="keyref">
@@ -309,6 +319,7 @@
                                         <xsl:attribute name="keyref">
                                             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
                                                 <xsl:with-param name="fid" select="$fid"/>
+                                                <!--<xsl:with-param name="end_fid" select="$end_fid"/>-->
                                                 <xsl:with-param name="title" select="$title"/>
                                                 <xsl:with-param name="get_wfs:name_from_fid" select="$get_wfs:name_from_fid"/>
                                             </xsl:call-template>
@@ -316,7 +327,7 @@
                                         <xsl:if test="$link__x3A__title"><xsl:copy-of select="$link__x3A__title"/></xsl:if>
                                     </xsl:when>
                                     <xsl:otherwise>
-                                        <xref>
+                                        <xref rev="#329">
                                             <xsl:attribute name="keyref" >
                                                 <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__key">
                                                     <xsl:with-param name="fid" select="$fid"/>

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

@@ -93,13 +93,13 @@
                 <xsl:call-template name="system_cache__dita:BI_audit_operational_raport_note_uniq">
                     <xsl:with-param name="BI_audit_operational_raport_note_fixed" select="$BI_audit_operational_raport_note_fixed"/>
                     <xsl:with-param name="sources" select="$sources"/>
-                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField" select="$default_db__x3A__BI_audit_BENFORD:valueField" />
-                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:groupField" select="$default_db__x3A__BI_audit_BENFORD:groupField" />
-                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField"/>
-                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField"/>
-                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:AddressField" select="$default_db__x3A__BI_audit_BENFORD:AddressField" />
-                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"   />
-                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  />
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField" select="$default_db__x3A__BI_audit_BENFORD:valueField"  tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:groupField" select="$default_db__x3A__BI_audit_BENFORD:groupField"  tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:timeField" select="$default_db__x3A__BI_audit_BENFORD:timeField" tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:NameField" select="$default_db__x3A__BI_audit_BENFORD:NameField" tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:AddressField" select="$default_db__x3A__BI_audit_BENFORD:AddressField" tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"   tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  tunnel="yes"/>
                 </xsl:call-template>
             </xsl:variable>
             

+ 7 - 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.sources.xsl

@@ -67,6 +67,7 @@
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:PeselField" required="yes"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" required="yes"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes" required="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"  tunnel="yes" />
         <interested_row>
             
             <xsl:for-each select="$context/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row">
@@ -107,7 +108,8 @@
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:AddressField" tunnel="yes" select="$default_db__x3A__BI_audit_BENFORD:AddressField"/>
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" tunnel="yes" select="$default_db__x3A__BI_audit_BENFORD:PeselField"/>
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" tunnel="yes" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"/>
-                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"></xsl:with-param>
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                             </xsl:apply-templates>
                         </xsl:element>
                     </xsl:when>
@@ -129,6 +131,7 @@
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:PeselField" tunnel="yes" required="yes"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" tunnel="yes" required="yes"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"  tunnel="yes"/>
         <xsl:copy>
             <xsl:attribute name="generate-id" select="generate-id()"/>
         <xsl:attribute name="system_cache__dita:interested_row.path">
@@ -152,6 +155,7 @@
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:PeselField" tunnel="yes" />
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" tunnel="yes" />
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"  tunnel="yes"/>
         <xsl:copy>
             <xsl:copy-of select="@*"/>
             <xsl:apply-templates mode="default_db__x3A__BI_audit_BENFORD:generate.leadingNumber" select="."/>
@@ -169,6 +173,7 @@
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:PeselField" tunnel="yes" />
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" tunnel="yes" />
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"  tunnel="yes"/>
                 <xsl:copy>
                     <xsl:copy-of select="@*"/>
                     <xsl:attribute name="generate-id" select="generate-id()"/>
@@ -207,6 +212,7 @@
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:AddressField" required="yes" />
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:PeselField" required="yes" />
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" required="yes" />
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"  tunnel="yes" />
         <system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.values.fixed>
             <xsl:for-each select="$sources/sources/source">
                 <xsl:variable name="source" select="."/>

+ 32 - 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.xsl

@@ -45,6 +45,8 @@
     <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_UMOWY.Wartosc" select="'Wartosc'"/>
     
     
+    <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_RUM_UMOWY.CostSubjectFields" select="'Glowny_numer_rejestrowy,Rejestrujacy_w_RUM___nazwisko_i_imie,Typ_umowy__aktualny_,Koniec_okresu_obowiazywania_umowy,Slowa_kluczowe_okreslajace_umowe'"/><!-- Numer_rejestrowy_u_Kontrahenta -->
+    
     <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_FAKTURY.data_sprzedazy" select="'data_sprzedazy'"/>
     <xsl:param name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_FAKTURY.Kwota_netto" select="'Kwota_netto'"/>
     
@@ -145,6 +147,10 @@
             <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:CostField"/>
         </xsl:variable>
         
+        <xsl:variable name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields">
+            <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"/>
+        </xsl:variable>
+        
         <xsl:variable name="dita">
             <xsl:apply-templates select="." mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_statystyka_pracownik.dita">
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField" select="$default_db__x3A__BI_audit_BENFORD:valueField" />
@@ -155,7 +161,7 @@
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
-                
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
             </xsl:apply-templates>
         </xsl:variable>
         <xsl:comment>#155 bocian-graph-2-html.preprocess </xsl:comment>
@@ -170,6 +176,7 @@
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
             </xsl:apply-templates>
         </xsl:for-each>
         
@@ -183,6 +190,7 @@
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
             </xsl:call-template>
         </xsl:variable>
         <xsl:comment>#180 bocian-graph-2-html.preprocess </xsl:comment>
@@ -198,6 +206,7 @@
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
             </xsl:apply-templates>
         </xsl:for-each>
         
@@ -214,6 +223,7 @@
             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"/>
             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"/>
             <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
         </xsl:apply-templates>
         
         <!-- GRAPHS BEGIN --><!-- GRAPHS BEGIN --><!-- GRAPHS BEGIN --><!-- GRAPHS BEGIN --><!-- GRAPHS BEGIN -->
@@ -256,6 +266,7 @@
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"/>
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
             </xsl:call-template>
         </xsl:variable>
         
@@ -275,6 +286,7 @@
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"/>
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"/>
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                 </xsl:call-template>
             </xsl:variable>
             
@@ -302,6 +314,7 @@
                 <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="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
             </xsl:call-template>
         </xsl:variable>
         
@@ -317,6 +330,7 @@
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField" />
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField" />
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
             </xsl:apply-templates>
         </xsl:for-each>
         
@@ -344,6 +358,7 @@
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField" />
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField" />
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                                 <!--<xsl:with-param name="fileindex" select="current-grouping-key()"/>-->
                             </xsl:apply-templates>
                     </xsl:for-each-group>
@@ -365,6 +380,7 @@
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField" />
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField" />
                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                 <!--<xsl:with-param name="fileindex" select="current-grouping-key()"/>-->
             </xsl:apply-templates>
         </xsl:for-each-group>
@@ -425,6 +441,11 @@
                 <xsl:variable name="default_db__x3A__BI_audit_BENFORD:CostField">
                     <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:CostField"/>
                 </xsl:variable>
+                
+                <xsl:variable name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields">
+                    <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields"/>
+                </xsl:variable>
+                
                 <xsl:call-template name="system_cache__dita:map.title">
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:valueField" select="$default_db__x3A__BI_audit_BENFORD:valueField" />
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:groupField" select="$default_db__x3A__BI_audit_BENFORD:groupField" />
@@ -434,6 +455,7 @@
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField" />
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField" />
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                 </xsl:call-template>
                 
                 <!-- osoby Akceptujacy_merytorycznie___nazwisko_i_imie -->
@@ -498,6 +520,7 @@
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField" />
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField" />
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                     </xsl:call-template>
                 </xsl:variable>
                 
@@ -850,6 +873,7 @@
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"  />
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  />
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                     </xsl:call-template>
                 </xsl:variable>
                 <topichead navtitle="Powiązania znalezione trasy (APT)" >
@@ -880,6 +904,7 @@
                         <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="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" 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>
                     
@@ -985,6 +1010,7 @@
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"  />
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  />
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                     </xsl:call-template>
                 </xsl:variable>
                 <topichead navtitle="Powiązania do wybranych podmiotów/kontrahentów (APU4)" >
@@ -1015,6 +1041,7 @@
                         <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="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                     </xsl:call-template>
                     
                 </topichead>
@@ -1156,6 +1183,7 @@
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"   />
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  />
                     <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                 </xsl:call-template>
                 
                 <topichead navtitle="Graf powiązań">
@@ -1170,6 +1198,7 @@
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"   />
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  />
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                             </xsl:apply-templates>
                         </xsl:result-document>
                     </topicref>
@@ -1187,6 +1216,7 @@
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"   />
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  />
                                 <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                             </xsl:apply-templates>
                         </xsl:result-document>
                     </topicref>
@@ -1200,6 +1230,7 @@
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:PeselField" select="$default_db__x3A__BI_audit_BENFORD:PeselField"   />
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:TaxIdField" select="$default_db__x3A__BI_audit_BENFORD:TaxIdField"  />
                         <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostField" select="$default_db__x3A__BI_audit_BENFORD:CostField" tunnel="yes"/>
+                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:CostSubjectFields" select="$default_db__x3A__BI_audit_BENFORD:CostSubjectFields" tunnel="yes"/>
                     </xsl:call-template>
                     
                     

+ 29 - 4
SE/schema/default_db_xml_cache.public/default_db/dateTime.xsl

@@ -75,11 +75,11 @@
             <!-- TU BYLA LINIA 41 -->
             <xsl:when test="string($date) castable as xs:dateTime">
                 <!--<xsl:message>#20 passed as dateTime</xsl:message>-->
-                <xsl:value-of select="format-date(xs:date(xs:dateTime($date)),'[Y-m]')"/>
+                <xsl:value-of select="format-date(xs:date(xs:dateTime($date)),'[Y-M]')"/>
             </xsl:when>
             <xsl:when test="string($date) castable as xs:date">
                 <!--<xsl:message>#20 passed as date</xsl:message>-->
-                <xsl:value-of select="format-date(xs:date($date),'[Y-m]')"/>
+                <xsl:value-of select="format-date(xs:date($date),'[Y-M]')"/>
             </xsl:when>
             <xsl:when test="tokenize(string($date),'\.')[3]">
                 <!--<xsl:message>#20 date passed as tokenize</xsl:message>-->
@@ -109,17 +109,42 @@
         
     </xsl:function>
     
+    
+    
+    <xsl:function name="system_cache__dita:year-timestamp-day">
+        <xsl:param name="date"/>
+        <xsl:choose>
+            
+            <xsl:when test="string($date) castable as xs:dateTime">
+                <!--<xsl:message>#20 passed as dateTime</xsl:message>-->
+                <xsl:value-of select="number(format-date(xs:date(xs:dateTime($date)),'[Y]')) * 365 * number(format-date(xs:date(xs:dateTime($date)),'[M]')) * 30 + number(format-date(xs:date(xs:dateTime($date)),'[D]'))"/>
+            </xsl:when>
+            <!--<xsl:when test="string($date) castable as xs:date">
+                <!-\-<xsl:message>#20 passed as date</xsl:message>-\->
+                <xsl:value-of select="number(format-date(xs:date($date),'[Y]')) * 365 * number(format-date(xs:date($date),'[M]')) * 30 + number(format-date(xs:date($date),'[D]'))"/>
+            </xsl:when>-->
+            <xsl:when test="string($date) castable as xs:date">
+                <!--<xsl:message>#20 passed as date</xsl:message>-->
+                <xsl:value-of select="number(format-date(xs:date($date),'[Y]')) * 365 + number(format-date(xs:date($date),'[M]')) * 30 + number(format-date(xs:date($date),'[D]'))"/>
+            </xsl:when>
+            
+        </xsl:choose>
+        
+        
+    </xsl:function>
+    
+    
     <xsl:function name="system_cache__dita:year-quarter">
         <xsl:param name="date"/>
         <xsl:choose>
             
             <xsl:when test="string($date) castable as xs:dateTime">
                 <!--<xsl:message>#20 passed as dateTime</xsl:message>-->
-                <xsl:value-of select="format-date(xs:date(xs:dateTime($date)),'[Y]')"/>|<xsl:value-of select="ceiling(number(format-date(xs:date(xs:dateTime($date)),'[m]')) div 3)"/>
+                <xsl:value-of select="format-date(xs:date(xs:dateTime($date)),'[Y]')"/>|<xsl:value-of select="ceiling(number(format-date(xs:date(xs:dateTime($date)),'[M]')) div 3)"/>
             </xsl:when>
             <xsl:when test="string($date) castable as xs:date">
                 <!--<xsl:message>#20 passed as date</xsl:message>-->
-                <xsl:value-of select="format-date(xs:date($date),'[Y]')"/>|<xsl:value-of select="ceiling(number(format-date(xs:date($date),'[m]')) div 3)"/>
+                <xsl:value-of select="format-date(xs:date($date),'[Y]')"/>|<xsl:value-of select="ceiling(number(format-date(xs:date($date),'[M]')) div 3)"/>
             </xsl:when>
             <xsl:when test="tokenize(string($date),'\.')[3]">
                 <!--<xsl:message>#20 date passed as tokenize</xsl:message>-->

+ 231 - 21
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl

@@ -81,9 +81,108 @@
             
         
             <dlentry>
-                <dt>Parametry wspólne zakresu danych</dt>
+                <xsl:variable name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y">
+                    <equation-inline>
+                        <xsl:call-template name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" />
+                    </equation-inline>
+                </xsl:variable>
+                <dt>Parametry wspólne zakresu danych
+                    
+                    <foreign rev="graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl#102">
+                            <xsl:copy-of select="$system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y"/>
+                        </foreign>
+                </dt>
+                <dd>
+                    <simpletable props="detect_Y.all nograph">
+                        <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>
+                        <strow>
+                            <stentry>
+                                L.p. 
+                            </stentry>
+                            <stentry>
+                                Osie Y 
+                            </stentry>
+                            <stentry>
+                                typ 
+                            </stentry>
+                            <stentry>
+                                ilość 
+                            </stentry>
+                            <stentry>
+                                wartość zakresu
+                            </stentry>
+                            <stentry>
+                                wartości 
+                            </stentry>
+                        </strow>
+                        <strow>
+                            <stentry>
+                                <ph> </ph>
+                            </stentry>
+                            <stentry>
+                                <ph>(wszy- stkie)</ph>
+                            </stentry>
+                            <stentry>
+                                <ph> </ph>
+                            </stentry>
+                            <stentry>
+                                <ph> </ph>
+                            </stentry>
+                            <stentry>
+                                <ph> </ph>
+                            </stentry>
+                            <stentry>
+                                <ph> </ph>
+                            </stentry>
+                        </strow>
+                        <!--<equation-inline>
+                            Osie Y (wszystkie)
+                        </equation-inline>-->
+                        
+                        
+                        
+                        
+                        
+                        <xsl:for-each-group select="$system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y//equation-inline[@props='yaxis']" group-by="descendant::*[@props='p5gnuplot__dat.sthead.ytics.row.xml__x3A__detect_Y']/text()">
+                            <!--<xsl:copy>
+                                <xsl:copy-of select="@*"/>-->
+                            <strow>
+                                <stentry>
+                                    <ph><xsl:value-of select="position()"/></ph>
+                                </stentry>
+                                <stentry>
+                                    <ph> - </ph>
+                                </stentry>
+                                <stentry>
+                                    <p><xsl:value-of select="current-grouping-key()"/></p> 
+                                </stentry>
+                                <stentry>
+                                    <p> <b><xsl:value-of select="count(current-group())"/></b></p> 
+                                </stentry>
+                                <stentry>
+                                    <p>
+                                        <xsl:value-of select="equation-inline[@props='p5gnuplot__file.row.y_detect_Y_488']"/>
+                                    </p> 
+                                </stentry>
+                                <stentry>
+                                    <p><xsl:for-each select="current-group()//*[@props='position']">
+                                        <b><xsl:value-of select="text()"/></b><xsl:if test="not(position()=last())"><xsl:text>, </xsl:text></xsl:if></xsl:for-each>
+                                    </p> 
+                                </stentry>
+                            </strow>
+                            
+                            <!--<foreign props="debug"><xsl:copy-of select="current-group()"></xsl:copy-of></foreign>-->
+                            <!--</xsl:copy>-->
+                        </xsl:for-each-group>
+                        <xsl:comment>#109 eof osie</xsl:comment>
+                    </simpletable>
+                </dd>
                 
-                <dd props="detect_Y.all">
+                <!--<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>
@@ -98,6 +197,11 @@
                                 <xsl:call-template name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" />
                             </equation-inline>
                         </xsl:variable>
+                    
+                    <foreign rev="graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl#102">
+                        <xsl:copy-of select="$system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y"/>
+                    </foreign>
+                    
                     <xsl:for-each-group select="$system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y//equation-inline[@props='yaxis']" group-by="descendant::*[@props='p5gnuplot__dat.sthead.ytics.row.xml__x3A__detect_Y']/text()">
                         <xsl:copy>
                             <xsl:copy-of select="@*"/>
@@ -106,11 +210,16 @@
                             <equation-inline> <b><xsl:value-of select="count(current-group())"/></b></equation-inline>
                             <equation-inline><xsl:for-each select="current-group()//*[@props='position']"><b><xsl:value-of select="text()"/></b><xsl:if test="not(position()=last())"><xsl:text>, </xsl:text></xsl:if></xsl:for-each></equation-inline>
                             <xsl:comment>#017 iso</xsl:comment>
-                            <!--<foreign props="debug"><xsl:copy-of select="current-group()"></xsl:copy-of></foreign>-->
+                            <!-\-<foreign props="debug"><xsl:copy-of select="current-group()"></xsl:copy-of></foreign>-\->
                         </xsl:copy>
                     </xsl:for-each-group>
                     <xsl:comment>#109 eof osie</xsl:comment>
-                </dd>
+                </dd>-->
+                <xsl:variable name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X">
+                    <xsl:call-template name="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X" >
+                        <xsl:with-param name="fileindex" select="$fileindex" tunnel="yes"/>
+                    </xsl:call-template>
+                </xsl:variable>
                 <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"/>
@@ -120,18 +229,86 @@
                     <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>
+                    
+                    <simpletable rev="graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl#133" props="nograph"><!-- equation-inline -->
+                        <!--<ol>-->
+                        <sthead>
+                            <stentry>l.p.</stentry>
+                            
+                            <stentry>
+                                typ        
+                            </stentry>
+                            <stentry>
+                                rodzaj wartośći
+                            </stentry>
+                            <stentry>
+                                wartość z zakresu
+                            </stentry>
+                            <stentry>
+                                wartość
+                            </stentry>
+                        </sthead>
+                        <xsl:for-each select="$system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X//equation-inline[@props='xaxis']">
+                            
+                                <strow>
+                                        <stentry><xsl:value-of select="ph[@props='p5gnuplot__dat.sthead.ytics.row_163_cnt']/equation-inline[@props='position']"/></stentry>
+                                    
+                                        <stentry>
+                                            <xsl:copy-of select="ph[@props='p5gnuplot__dat.sthead.ytics.row_163']/b"/>        
+                                        </stentry>
+                                        <stentry>
+                                            <xsl:copy-of select="*[@props='p5gnuplot__dat.sthead.ytics.row_199_props']"/>
+                                        </stentry>
+                                        <stentry>
+                                                <xsl:copy-of select="*[@props='p5gnuplot__dat.sthead.ytics.row_396']"/>
+                                        </stentry>
+                                        <stentry>
+                                        <xsl:choose>
+                                            <xsl:when test="number(*[@props='p5gnuplot:value.max']) = number(*[@props='p5gnuplot:value.min']) and number(*[@props='p5gnuplot:value.min']) = number(*[@props='p5gnuplot:value'])">
+                                                <ph> 
+                                                    <xsl:value-of select="*[@props='p5gnuplot:value']"/>
+                                                </ph>
+                                            </xsl:when>
+                                            <xsl:otherwise>
+                                                <o> 
+                                                    <xsl:value-of select="*[@props='p5gnuplot:value']"/>
+                                                </o>
+                                                <p>
+                                                    <sub>max</sub>
+                                                    <ph> 
+                                                        <xsl:value-of select="*[@props='p5gnuplot:value.max']"/>
+                                                    </ph>    
+                                                </p>
+                                                <p>
+                                                    <sub>min</sub>
+                                                    <ph> 
+                                                        <xsl:value-of select="*[@props='p5gnuplot:value.min']"/>
+                                                    </ph>    
+                                                </p>
+                                                
+                                            </xsl:otherwise>
+                                        </xsl:choose>
+                                        </stentry>
+                                        
+                                    
+                                    
+                                    
+                                    
+                                    
+                                </strow>
+                           
+                        </xsl:for-each>
+                    </simpletable>
+                        <!--</ol>-->
+                        <!--<xsl:copy-of select="$system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X"/>-->
+                    
+
+                    
                 </dd>
                 
                 
                 
+                
             </dlentry>
             
             
@@ -150,7 +327,7 @@
                     </xsl:apply-templates>
                 </xsl:variable>-->
                 <xsl:variable name="test_if_go_row">
-                    <test_if_go_row>
+                    <test_if_go_row rev="$fileindex={$fileindex}">
                         <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()"/>
@@ -160,6 +337,9 @@
                                 <xsl:when test="current-group()[number()]">
                                     <NUMBER/>
                                 </xsl:when>
+                                <xsl:when test="current-group()">
+                                    <NUMBER rev="#341 todo not number()"/>
+                                </xsl:when>
                             </xsl:choose>
                             <xsl:variable name="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
                                 
@@ -171,10 +351,16 @@
                                 
                                 
                             </xsl:variable>
+                            <!--<foreign rev="351 deb system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
+                                <xsl:copy-of select="$system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect"></xsl:copy-of>
+                            </foreign>-->
                             <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: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 ">
+                                    <DATA_AVIABLE rev="#359 not number(current-group() todo)"/>
+                                </xsl:when>
                             </xsl:choose>
                             
                         </xsl:for-each-group>
@@ -232,15 +418,14 @@
                         
                     </xsl:when>
                     <xsl:otherwise>
+                        <foreign rev="#412 test_if_go_row">
+                            <xsl:copy-of select="$test_if_go_row"/>
+                        </foreign>
                         <xsl:comment>#183 not data</xsl:comment>
                     </xsl:otherwise>
                 </xsl:choose>
                 
                 
-              
-                    
-                    
-                        
                             <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"/>
@@ -264,7 +449,7 @@
                     </dd>
                 </dlentry>-->
             </xsl:for-each>
-            <dlentry rev="graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl#267">
+            <dlentry rev="graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl#267 $fileindex={$fileindex}">
                 <dt>
                     Podsumowanie całościowe
                 </dt>
@@ -301,6 +486,22 @@
         
     </xsl:template>
     
+    <!--
+    <xsl:template mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" match="p5gnuplot:ytics.path.row">
+        <!-\-<foreign rev="graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl#311">
+            <xsl:copy-of select="."/>
+        </foreign>-\->
+        <xsl:apply-templates mode="#current"/>
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" match="p5gnuplot:dat.strow">
+        
+        <ph props="p5gnuplot:dat.strow">
+            <xsl:value-of select="@p5gnuplot:value"/>
+        </ph>
+    </xsl:template>
+    -->
+    
     
     <xsl:template mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_Y" match="p5gnuplot:dat.sthead">
         <equation-inline props="yaxis">
@@ -308,7 +509,7 @@
         <ph props="p5gnuplot__dat.sthead.ytics.row.xml__x3A__detect_Y">
             <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.yaxis.platform"/>
         </ph>
-            <equation-inline>
+            <equation-inline props="p5gnuplot__file.row.y_detect_Y_488">
             <xsl:value-of select="@p5gnuplot:value"/>
         </equation-inline>
         </equation-inline>
@@ -336,15 +537,24 @@
     <xsl:template mode="system_cache__dita:graph.dat.row__x3A__from__ytics.xml__x3A__detect_X" match="p5gnuplot:dat.sthead.ytics.row">
         <equation-inline props="xaxis">
         <ph props="p5gnuplot__dat.sthead.ytics.row_163_cnt"><xsl:if test="count(preceding::p5gnuplot:dat.sthead.ytics.row) &gt;0">, </xsl:if><equation-inline props="position"><xsl:value-of select="count(preceding::p5gnuplot:dat.sthead.ytics.row)+1"/></equation-inline>) </ph>
-        <ph props="p5gnuplot__dat.sthead.ytics.row_163">
+        <ph props="p5gnuplot__dat.sthead.ytics.row_163" platform="{@system_cache__dita:graph.xaxis.platform}">
             <b><xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.xaxis.platform"/></b>
         </ph>
         <ph props="p5gnuplot__dat.sthead.ytics.row_199_props">
             <xsl:apply-templates mode="system_cache__dita:localname.translate" select="@system_cache__dita:graph.xaxis.props"/>
         </ph>
-            <equation-inline>
+            <equation-inline props="p5gnuplot__dat.sthead.ytics.row_396">
             <xsl:value-of select="@p5gnuplot:value"/>
         </equation-inline>
+            <!--<xsl:for-each select="following-sibling::p5gnuplot:ytics.path.row/p5gnuplot:dat.strow">-->
+                <foreign props="p5gnuplot:value.max"> <xsl:value-of select="max(following-sibling::p5gnuplot:ytics.path.row/p5gnuplot:dat.strow/number(@p5gnuplot:value))"/></foreign>
+                <foreign props="p5gnuplot:value.min"> <xsl:value-of select="min(following-sibling::p5gnuplot:ytics.path.row/p5gnuplot:dat.strow/number(@p5gnuplot:value))"/></foreign>
+            <xsl:for-each select="following-sibling::p5gnuplot:ytics.path.row/p5gnuplot:dat.strow/@p5gnuplot:value">
+                <foreign props="p5gnuplot:value" p5gnuplot:position="{position()}"><xsl:value-of select="."/></foreign>
+            </xsl:for-each>
+                <!--<equation-inline props="dat.strow.value"> min[ <xsl:value-of select="min(following-sibling::p5gnuplot:ytics.path.row/p5gnuplot:dat.strow/number(@p5gnuplot:value))"/>] </equation-inline>-->
+            <!--</xsl:for-each>-->
+            
         </equation-inline>
     </xsl:template>
     

+ 176 - 66
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats.xsl

@@ -7,6 +7,8 @@
     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:p5gnuplot__x3A__system_cache__dita="http://biuro.biall-net.pl/WPS_Functions/p5gnuplot__x3A__system_cache__dita/p5gnuplot__x3A__system_cache__dita.xsd"
+    xmlns:system_cache__dita__x3A__p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/system_cache__dita__x3A__p5gnuplot/system_cache__dita__x3A__p5gnuplot.xsd"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -21,7 +23,8 @@
     
     
     <xsl:template name="p5gnuplot:simpletable__x3A__graph.stats">
-        <xsl:param name="system_cache__dita:context.path.attrs.nodeset" required="yes"/>
+        <xsl:param name="system_cache__dita:context.path.attrs.nodeset" required="no"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" required="no" tunnel="yes"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:FieldType" required="no"/>
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:ValueType" required="yes"/><!-- which field value to use  attr -->
         <xsl:param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$default_db__x3A__BI_audit_BENFORD:FieldType" /><!-- which field value to use  attr -->
@@ -31,86 +34,182 @@
         <xsl:param name="group.count__x3A__path__x3A__length"/>
         <xsl:param name="group.sum"/>
         <xsl:param name="audience"/>
-        <strow props="graph.stats" rev="graph_gnuplot.simpletable__x3A__graph.stats.xsl#34 $p5gnuplot:simpletable__x3A__graph.stats.group_by.root={$p5gnuplot:simpletable__x3A__graph.stats.group_by.root}">
+        <strow props="graph.stats" rev="graph_gnuplot.simpletable__x3A__graph.stats.xsl#34 $audience={$audience} $p5gnuplot:simpletable__x3A__graph.stats.group_by.root={$p5gnuplot:simpletable__x3A__graph.stats.group_by.root}" >
+            <xsl:attribute name="default_db__x3A__BI_audit_BENFORD:FieldType.param" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+            <xsl:attribute name="default_db__x3A__BI_audit_BENFORD:ValueType.param" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+            <xsl:attribute name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root.param" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+            <xsl:attribute name="p5gnuplot:simpletable__x3A__graph.stats.group_by.param" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>
+            <xsl:attribute name="group.root.param" select="$group.root"/>
+            <xsl:attribute name="group.count.param" select="$group.count"/>
+            <xsl:attribute name="group.sum.param" select="$group.sum"/>
+            <xsl:attribute name="audience.param" select="$audience"/>
+            <!-- $system_cache__dita:context.path.attrs.nodeset/n = <xsl:value-of select="$system_cache__dita:context.path.attrs.nodeset/name()"/> -->
             
             
             <xsl:comment>#38 $p5gnuplot:simpletable__x3A__graph.stats.group_by.root = <xsl:value-of select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/> ; $default_db__x3A__BI_audit_BENFORD:FieldType = <xsl:value-of select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>; </xsl:comment>
             <xsl:comment>#39 p5gnuplot:simpletable__x3A__graph.stats.group_by = <xsl:value-of select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/> ; $$default_db__x3A__BI_audit_BENFORD:ValueType = <xsl:value-of select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>; </xsl:comment>
             
                     <xsl:variable name="current-group.parent.count" select="count(current-group())"/>
-            <xsl:for-each-group select="$system_cache__dita:context.path.attrs.nodeset/*/*"
-                group-by="@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]">
-                <xsl:sort select="@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]" order="ascending"/>
+            
+            <xsl:choose>
+                <xsl:when test="$system_cache__dita:context.path.attrs.nodeset">
+                    <xsl:for-each-group select="$system_cache__dita:context.path.attrs.nodeset/*/*"
+                        group-by="@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]">
+                        <xsl:sort select="@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]" order="ascending"/>
                         <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="count(current-group())"/></stentry>-->
                         <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/></stentry>-->
                         
-                <xsl:if test="$group.root">      
-                    <stentry props="group.root" rev="generate-id={current-group()/@generate-id}  p5gnuplot:simpletable__x3A__graph.stats.group_by.root= {$p5gnuplot:simpletable__x3A__graph.stats.group_by.root}   default_db__x3A__BI_audit_BENFORD:FieldType={$default_db__x3A__BI_audit_BENFORD:FieldType} default_db__x3A__BI_audit_BENFORD:ValueType={$default_db__x3A__BI_audit_BENFORD:ValueType}"  
-                        audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]}" current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]}" ><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>
-                    
-                            <xsl:call-template name="p5gnuplot:set.graph.group">
-                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                                <xsl:with-param name="group__x3A__value" select="$group.root"/>
-                            </xsl:call-template>
-                            <xsl:for-each select="current-group()">
-                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
-                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
-                                </xsl:apply-templates>
-                            </xsl:for-each>
-                            <!--<xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/>--></stentry>
-                </xsl:if>
+                        <xsl:if test="$group.root">      
+                            <stentry props="group.root" rev="generate-id={current-group()/@generate-id}  p5gnuplot:simpletable__x3A__graph.stats.group_by.root= {$p5gnuplot:simpletable__x3A__graph.stats.group_by.root}   default_db__x3A__BI_audit_BENFORD:FieldType={$default_db__x3A__BI_audit_BENFORD:FieldType} default_db__x3A__BI_audit_BENFORD:ValueType={$default_db__x3A__BI_audit_BENFORD:ValueType}"  
+                                audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]}" current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]}" ><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>
+                                
+                                <xsl:call-template name="p5gnuplot:set.graph.group">
+                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                    <xsl:with-param name="group__x3A__value" select="$group.root"/>
+                                </xsl:call-template>
+                                <xsl:for-each select="current-group()">
+                                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                    </xsl:apply-templates>
+                                </xsl:for-each>
+                                <!--<xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/>--></stentry>
+                        </xsl:if>
                         <xsl:for-each-group  select="current-group()" group-by="@*[name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by]"><!-- todo other -->
-                                    <xsl:sort select="number(@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ])" data-type="number" order="ascending"/>
+                            <xsl:sort select="number(@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ])" data-type="number" order="ascending"/>
+                            
+                            <xsl:if test="$group.sum">
+                                <stentry rev=" group-by {$p5gnuplot:simpletable__x3A__graph.stats.group_by}"   props="group.sum"  current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"  audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
+                                    <xsl:call-template name="p5gnuplot:set.graph.group">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                        <xsl:with-param name="group__x3A__value" select="$group.sum"/>
+                                    </xsl:call-template>
                                     
-                                    <xsl:if test="$group.sum">
-                                        <stentry rev=" group-by {$p5gnuplot:simpletable__x3A__graph.stats.group_by}"   props="group.sum"  current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"  audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
-                                            <xsl:call-template name="p5gnuplot:set.graph.group">
-                                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                                                <xsl:with-param name="group__x3A__value" select="$group.sum"/>
-                                            </xsl:call-template>
+                                    <xsl:for-each select="current-group()">
+                                        <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
                                             
-                                            <xsl:for-each select="current-group()">
-                                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
-                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
-                                                    
-                                                </xsl:apply-templates>
-                                            </xsl:for-each>
-                                        </stentry>
-                                    </xsl:if>
-                                    <xsl:if test="$group.count">
-                                    <stentry props="group.count" current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"  audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}">
-                                            <xsl:call-template name="p5gnuplot:set.graph.group">
-                                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                                                <xsl:with-param name="group__x3A__value" select="$group.count"/>
-                                            </xsl:call-template>
-                                            <xsl:for-each select="current-group()">
-                                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
-                                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
-                                                </xsl:apply-templates>
-                                            </xsl:for-each>
-                                        </stentry>
-                                    </xsl:if>
-                                </xsl:for-each-group>
+                                        </xsl:apply-templates>
+                                    </xsl:for-each>
+                                </stentry>
+                            </xsl:if>
+                            <xsl:if test="$group.count">
+                                <stentry props="group.count" current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"  audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}">
+                                    <xsl:call-template name="p5gnuplot:set.graph.group">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                        <xsl:with-param name="group__x3A__value" select="$group.count"/>
+                                    </xsl:call-template>
+                                    <xsl:for-each select="current-group()">
+                                        <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                        </xsl:apply-templates>
+                                    </xsl:for-each>
+                                </stentry>
+                            </xsl:if>
+                        </xsl:for-each-group>
                         
                         
-                
-                <xsl:if test="$group.count__x3A__path__x3A__length">
-                    <stentry props="group.count__x3A__path__x3A__length" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
-                        <xsl:call-template name="p5gnuplot:set.graph.group">
-                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
-                            <xsl:with-param name="group__x3A__value" select="$group.count__x3A__path__x3A__length"/>
-                        </xsl:call-template>
                         
-                        <xsl:for-each select="current-group()">
-                            <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
-                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                        <xsl:if test="$group.count__x3A__path__x3A__length">
+                            <stentry props="group.count__x3A__path__x3A__length" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
+                                <xsl:call-template name="p5gnuplot:set.graph.group">
+                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                    <xsl:with-param name="group__x3A__value" select="$group.count__x3A__path__x3A__length"/>
+                                </xsl:call-template>
                                 
-                            </xsl:apply-templates>
-                        </xsl:for-each>
-                    </stentry>
-                </xsl:if>
-                
+                                <xsl:for-each select="current-group()">
+                                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                        
+                                    </xsl:apply-templates>
+                                </xsl:for-each>
+                            </stentry>
+                        </xsl:if>
+                        
                     </xsl:for-each-group>
+                </xsl:when>
+                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable">
+                    <xsl:for-each-group select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable"
+                        group-by="@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]">
+                        <xsl:sort select="@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]" order="ascending"/>
+                        <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="count(current-group())"/></stentry>-->
+                        <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/></stentry>-->
+                        
+                        <xsl:if test="$group.root">      
+                            <stentry props="group.root" rev="generate-id={current-group()/@generate-id}  p5gnuplot:simpletable__x3A__graph.stats.group_by.root= {$p5gnuplot:simpletable__x3A__graph.stats.group_by.root}   default_db__x3A__BI_audit_BENFORD:FieldType={$default_db__x3A__BI_audit_BENFORD:FieldType} default_db__x3A__BI_audit_BENFORD:ValueType={$default_db__x3A__BI_audit_BENFORD:ValueType}"  
+                                audience="{$audience}" current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]}" >
+                                <!-- {@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by.root ]} -->
+                                <xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>
+                                
+                                <xsl:call-template name="p5gnuplot:set.graph.group">
+                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                    <xsl:with-param name="group__x3A__value" select="$group.root"/>
+                                </xsl:call-template>
+                                <xsl:for-each select="current-group()">
+                                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                    </xsl:apply-templates>
+                                </xsl:for-each>
+                                <!--<xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/>--></stentry>
+                        </xsl:if>
+                        <xsl:for-each-group  select="current-group()" group-by="@*[name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by]"><!-- todo other -->
+                            <xsl:sort select="number(@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ])" data-type="number" order="ascending"/>
+                            
+                            <xsl:if test="$group.sum">
+                                <stentry rev=" group-by {$p5gnuplot:simpletable__x3A__graph.stats.group_by}"   props="group.sum"  current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"  audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
+                                    <xsl:call-template name="p5gnuplot:set.graph.group">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                        <xsl:with-param name="group__x3A__value" select="$group.sum"/>
+                                    </xsl:call-template>
+                                    
+                                    <xsl:for-each select="current-group()">
+                                        <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                            
+                                        </xsl:apply-templates>
+                                    </xsl:for-each>
+                                </stentry>
+                            </xsl:if>
+                            <xsl:if test="$group.count">
+                                <stentry props="group.count" current-grouping-key="{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}"  audience="{$audience}_{@*[ name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by ]}">
+                                    <xsl:call-template name="p5gnuplot:set.graph.group">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                        <xsl:with-param name="group__x3A__value" select="$group.count"/>
+                                    </xsl:call-template>
+                                    <xsl:for-each select="current-group()">
+                                        <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                        </xsl:apply-templates>
+                                    </xsl:for-each>
+                                </stentry>
+                            </xsl:if>
+                        </xsl:for-each-group>
+                        
+                        
+                        
+                        <xsl:if test="$group.count__x3A__path__x3A__length">
+                            <stentry props="group.count__x3A__path__x3A__length" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
+                                <xsl:call-template name="p5gnuplot:set.graph.group">
+                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                    <xsl:with-param name="group__x3A__value" select="$group.count__x3A__path__x3A__length"/>
+                                </xsl:call-template>
+                                
+                                <xsl:for-each select="current-group()">
+                                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                        
+                                    </xsl:apply-templates>
+                                </xsl:for-each>
+                            </stentry>
+                        </xsl:if>
+                        
+                    </xsl:for-each-group>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:message terminate="no">#200 p5gnuplot:simpletable__x3A__graph.stats WARNING unset or $system_cache__dita:context.path.attrs.nodeset or $system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable requred param </xsl:message>
+                </xsl:otherwise>
+            </xsl:choose>
+            
+                    
             
             
         </strow>
@@ -119,12 +218,23 @@
     <xsl:template mode="p5gnuplot:simpletable__x3A__graph.stats" match="@fid">
         <xsl:param name="default_db__x3A__BI_audit_BENFORD:FieldType" required="yes"/>
         
-        <p5gnuplot:stats props="fid">
+        <p5gnuplot:stats props="fid" rev="debug $default_db__x3A__BI_audit_BENFORD:FieldType={$default_db__x3A__BI_audit_BENFORD:FieldType}  @default_db__x3A__BI_audit_BENFORD:CostField={parent::*/@default_db__x3A__BI_audit_BENFORD:CostField}">
             <xsl:copy-of select="."/>
             <xsl:attribute name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
             
             <xsl:apply-templates mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs" select="parent::*/@*"/>
-            <xsl:value-of select="../*[@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType]]/text()"/><xsl:text></xsl:text><!-- *[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]] -->
+            <xsl:choose>
+                <xsl:when test="number(../*[@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType]]/text()) &gt;0">
+                    <xsl:value-of select="../*[@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType]]/text()"/><xsl:text></xsl:text>
+                </xsl:when>
+                <xsl:when test="$default_db__x3A__BI_audit_BENFORD:FieldType = 'default_db__x3A__BI_audit_BENFORD:CostField' and number(parent::*/@default_db__x3A__BI_audit_BENFORD:CostField)">
+                    <xsl:value-of select="parent::*/@default_db__x3A__BI_audit_BENFORD:CostField"/><xsl:text></xsl:text>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="../*[@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType]]/text()"/><xsl:text></xsl:text>
+                </xsl:otherwise>
+            </xsl:choose>
+            <!-- *[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]] -->
         </p5gnuplot:stats>
     </xsl:template>
     

+ 168 - 66
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl

@@ -8,6 +8,7 @@
     xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA="https://biuro.biall-net.pl/wfs/default_db/ENERGA_RUM_KONTRAHENCI_POWIAZANIA"
     xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
     xmlns:Linear_regression="https://en.wikipedia.org/wiki/Linear_regression"
+    xmlns:p5gnuplot__x3A__system_cache__dita="http://biuro.biall-net.pl/WPS_Functions/p5gnuplot__x3A__system_cache__dita/p5gnuplot__x3A__system_cache__dita.xsd"
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -89,11 +90,15 @@
                 </xsl:call-template>
             </xsl:variable>
             <xsl:variable name="col" select="parent::*/@col"/>
+            <xsl:variable name="audience" select="parent::*/@audience"/>
+            <xsl:variable name="group" select="parent::*/@group"/>
             <!--<dd>col=<xsl:value-of select="$col"/>;$p5gnuplot:value=<xsl:value-of select="$p5gnuplot:value"/>;$system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect=<xsl:value-of select="$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"/>
                 Test:<xsl:value-of select="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect($system_cache__dita:graph.ytics_detect_row,$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y,$col)"/>
             </dd>-->
-            
-            
+            <!--<foreign rev="#98 stentry/p5gnuplot:stats col={$col}  audience={$audience}  group={$group}   current-grouping-key={current-grouping-key()}"></foreign>-->
+            <!--<foreign rev="#988 COPY">
+                <xsl:copy-of select="current-group()"></xsl:copy-of>
+            </foreign>-->
             
                 <xsl:choose>
                     <xsl:when test="count(current-group())=0">
@@ -108,7 +113,7 @@
                         
                         <xsl:element name="dt">
                             <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
-                                Grupa <xsl:value-of select="current-grouping-key()"/> / <xsl:value-of select="@audience"/> / <xsl:value-of select="@group"/>  <!-- fid <xsl:value-of select="@fid"/> col=<xsl:value-of select="parent::*/@col"/> ;  <xsl:value-of select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y//varname[@props='system_cache__dita:graph.ytics_detect_row']/text()"/> -->
+                                Grupa <!--<xsl:value-of select="@current-grouping-key"/> /--> <!--<xsl:value-of select="current-grouping-key()"/>-->  <xsl:value-of select="$group"/> / <xsl:value-of select="$audience"/>  <!-- fid <xsl:value-of select="@fid"/> col=<xsl:value-of select="parent::*/@col"/> ;  <xsl:value-of select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y//varname[@props='system_cache__dita:graph.ytics_detect_row']/text()"/> -->
                             </xsl:element>
                            <!--dla grupy <xsl:value-of select="current-grouping-key()"/>; p5gnuplot:stats/@fid=<xsl:value-of select="p5gnuplot:stats/@fid"/> , name=<xsl:value-of select="name()"/>-->
                                                 <!-- min fid 1 = <xsl:value-of select="current-group()//p5gnuplot:stats/number(text())"/>
@@ -123,77 +128,140 @@
                                         min fid 33vb = <xsl:value-of select="current-group()//p5gnuplot:stats[ text()=min(current-group()//p5gnuplot:stats/number(text())) ]/parent::stentry/@props"/>-->
                         </xsl:element>
                         
-                        <dd>
+                        <dd rev="p5gnuplot:value={$p5gnuplot:value}">
                             Wartości skrajne 
                         </dd>
                         
                         </dlentry>
                         <xsl:if test="count(current-group()) &gt; 3">
-                            <dlentry rev="graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl#132">
-                                <!--<xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
-                                    <xsl:with-param name="fid" select="$fid"/>
-                                    <xsl:with-param name="fileindex" select="$fileindex"/>
-                                    <!-\-<xsl:with-param name="graph.name" select="@fid"/>-\->
-                                    <xsl:with-param name="system_cache__dita:element__x3A__name">dlentry</xsl:with-param>
-                                </xsl:call-template>-->
-                                
-                                <dt>
-                                    Analiza regresji liniowej 
-                                </dt>
-                                <dd>
-                                    <xsl:variable name="Linear_regression:calculate_data">
-                                    <xsl:call-template name="Linear_regression:calculate_data">
-                                        <!--<xsl:with-param name="Linear_regression:X_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingNumber</xsl:with-param>-->
-                                        <xsl:with-param name="Linear_regression:X_element__x3A__set">p5gnuplot:stats</xsl:with-param>
-                                        <xsl:with-param name="Linear_regression:Y_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month</xsl:with-param>
-                                        <xsl:with-param name="Linear_regression:dataset" select="current-group()"/>
-                                        <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
-                                    </xsl:call-template>
-                                    </xsl:variable>
-                                    <xsl:apply-templates mode="Linear_regression:calculate_data__x3A__to_dita" select="$Linear_regression:calculate_data"/>
-                                    <foreign>
+                            
+                            <xsl:variable name="Linear_regression:calculate_data">
+                                <xsl:call-template name="Linear_regression:calculate_data">
+                                    <!--<xsl:with-param name="Linear_regression:X_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingNumber</xsl:with-param>-->
+                                    <xsl:with-param name="Linear_regression:X_element__x3A__set">p5gnuplot:stats</xsl:with-param>
+                                    <xsl:with-param name="Linear_regression:Y_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month</xsl:with-param>
+                                    <xsl:with-param name="Linear_regression:dataset" select="current-group()"/>
+                                    <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
+                                </xsl:call-template>
+                            </xsl:variable>
+                            <xsl:choose>
+                                <xsl:when test="$Linear_regression:calculate_data//Linear_regression:X[text()='NaN']">
+                                    <foreign rev="#144 $Linear_regression:calculate_data//Linear_regression:X[text()='NaN']  $p5gnuplot:value={$p5gnuplot:value}"/>
+                                        
+                                    
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <foreign rev="#152 $Linear_regression:calculate_data $p5gnuplot:value={$p5gnuplot:value}">
                                         <xsl:copy-of select="$Linear_regression:calculate_data"/>
                                     </foreign>
-                                </dd>
-                                
-                            </dlentry>   
+                                    <dlentry rev="graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl#132">
+                                        <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+                                            <xsl:with-param name="fid" select="$fid"/>
+                                            <xsl:with-param name="fileindex" select="$fileindex"/>
+                                            <!--<xsl:with-param name="graph.name" select="@fid"/>-->
+                                            <xsl:with-param name="system_cache__dita:element__x3A__name">dlentry</xsl:with-param>
+                                        </xsl:call-template>
+                                        
+                                        <dt>
+                                            Analiza regresji liniowej 
+                                        </dt>
+                                        <dd>
+                                            
+                                            <xsl:apply-templates mode="Linear_regression:calculate_data__x3A__to_dita" select="$Linear_regression:calculate_data"/>
+                                            <foreign rev="Linear_regression:calculate_data #165">
+                                                <xsl:copy-of select="$Linear_regression:calculate_data"/>
+                                            </foreign>
+                                        </dd>
+                                        
+                                    </dlentry>
+                                </xsl:otherwise>
+                            </xsl:choose>
+                               
                         </xsl:if>
                         
                         <xsl:choose>
-                            <xsl:when test="number(current-group()[1])">
+                            <xsl:when test="number(current-group()[1]) or number(current-group()[1])=0">
                                 <dlentry rev="graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl#164">
-                                    <dt>
-                                        min/max
-                                    </dt>
-                                    <xsl:element name="dd">
-                                        <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
-                                            Minimum: <b><xsl:value-of select="system_cache__dita:big_values_format(min(current-group()/number(text())))"/></b> 
-                                            <!--<foreign>current-group()/name()= <xsl:value-of select="current-group()[1]/name()"/> , text()=<xsl:value-of select="text()"/></foreign>-->
+                                    <xsl:variable name="current-group.number">
+                                        <current-group.number rev="{@rev}">
+                                            <xsl:for-each select="current-group()">
+                                                <xsl:if test="number(text())">
+                                                    <number fid="{@fid}"><xsl:value-of select="number(text())"/></number>    
+                                                </xsl:if>
+                                            </xsl:for-each>
+                                            <xsl:for-each select="current-group()">
+                                                <xsl:sort select="number(text())" order="descending"/>
+                                                <xsl:if test="number(text())">
+                                                    <number-max fid="{@fid}"><xsl:value-of select="number(text())"/></number-max>    
+                                                </xsl:if>
+                                            </xsl:for-each>
+                                        </current-group.number>
+                                    </xsl:variable>
+                                    <!--<foreign rev="current-group.number #184 " props="max: {$current-group.number//number-max[1]/@fid}">
+                                        <xsl:copy-of select="$current-group.number"/>
+                                    </foreign>-->
+                                    <xsl:if test="$current-group.number//number">
+                                        <dt>
+                                            min/max
+                                        </dt>
+                                        <xsl:element name="dd">
+                                            <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
+                                                Minimum: <b><xsl:value-of select="system_cache__dita:big_values_format(min($current-group.number//number))"/></b> 
+                                                <!--<foreign>current-group()/name()= <xsl:value-of select="current-group()[1]/name()"/> , text()=<xsl:value-of select="text()"/></foreign>-->
+                                            </xsl:element>
+                                            <!--<xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
+                                                <xsl:value-of select="min(current-group()/number(text()))"/> 
+                                                <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
+                                                    <xsl:with-param name="fid" select="current-group()[ text()=min(current-group()/number(text())) ][1]/@fid"/>
+                                                </xsl:call-template>
+                                            </xsl:element>-->
                                         </xsl:element>
-                                        <!--<xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
-                                            <xsl:value-of select="min(current-group()/number(text()))"/> 
+                                    </xsl:if>
+                                    <xsl:choose>
+                                        
+                                    
+                                    <xsl:when test="$current-group.number//number-max[1]">
+                                        <xsl:element name="dd">
+                                            <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
+                                                Maximum: <b><xsl:value-of select="system_cache__dita:big_values_format($current-group.number//number-max[1])"/></b> 
+                                            </xsl:element>
                                             <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
-                                                <xsl:with-param name="fid" select="current-group()[ text()=min(current-group()/number(text())) ][1]/@fid"/>
+                                                <!--<xsl:with-param name="fid" select="current-group()[ max(number(text()))]/@fid"/>-->
+                                                <xsl:with-param name="fid" select="$current-group.number//number-max[1]/@fid" />
+                                                
                                             </xsl:call-template>
-                                        </xsl:element>-->
-                                    </xsl:element>
-                                    <xsl:element name="dd">
-                                        <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
-                                            Maximum: <b><xsl:value-of select="system_cache__dita:big_values_format(max(current-group()/number(text())))"/></b> 
                                         </xsl:element>
-                                        <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
-                                            <xsl:with-param name="fid" select="current-group()[ max(number(text()))]/@fid"/>
-                                        </xsl:call-template>
-                                    </xsl:element>
-                                    <xsl:element name="dd">
-                                        Średnia: <b><xsl:value-of select="system_cache__dita:big_values_format(avg(current-group()/number(text())))"/></b> 
-                                    </xsl:element>
-                                    <xsl:element name="dd">
-                                        Suma: <b><xsl:value-of select="system_cache__dita:big_values_format(sum(current-group()/number(text())))"/></b> 
-                                    </xsl:element>
-                                    <xsl:element name="dd">
-                                        Ilość: <b><xsl:value-of select="count(current-group()/number(text()))"/></b> 
-                                    </xsl:element>
+                                        <xsl:element name="dd">
+                                            Średnia: <b><xsl:value-of select="system_cache__dita:big_values_format(avg($current-group.number//number))"/></b> 
+                                        </xsl:element>
+                                        <xsl:element name="dd">
+                                            Suma: <b>
+                                                <!--<xsl:attribute name="rev">
+                                                <xsl:for-each select="current-group()">
+                                                    <xsl:if test="number(text())">
+                                                        <xsl:value-of select="text()"/><xsl:text> ; </xsl:text>    
+                                                    </xsl:if>
+                                                </xsl:for-each>
+                                            </xsl:attribute>-->
+                                                <xsl:value-of select="system_cache__dita:big_values_format(sum($current-group.number//number))"/>
+                                                <!--<xsl:value-of select="sum($current-group.number//number)"/>-->
+                                            </b> 
+                                        </xsl:element>
+                                        <xsl:element name="dd">
+                                            Ilość: <b><xsl:value-of select="count(current-group())"/></b><!-- number(text() --> 
+                                        </xsl:element>
+                                        <!--<foreign rev="253A  found $current-group.number//number">
+                                            <xsl:copy-of select="$current-group.number"/>
+                                        </foreign>-->
+                                    </xsl:when>
+                                    <!--<xsl:otherwise>
+                                        <foreign rev="253 not found $current-group.number//number">
+                                            <xsl:copy-of select="$current-group.number"/>
+                                        </foreign>
+                                    </xsl:otherwise>-->
+                                    </xsl:choose>
+                                    
+                                    
                                 </dlentry>
                             </xsl:when>
                             <xsl:otherwise>
@@ -201,7 +269,7 @@
                                     <dt>
                                         wykrycie danych 
                                     </dt>
-                                    <dd>nieudane (brak wartości w zestawie danych) [<!--<xsl:value-of select="current-group()//[1]text()[1]"/>-->]</dd>
+                                    <dd rev="{current-group()[1]/name()} /t {current-group()[1]/text()} /n {number(current-group()[1])}">nieudane (brak wartości w zestawie danych) [<!--<xsl:value-of select="current-group()//[1]text()[1]"/>-->]</dd>
                                 </dlentry>
                                 
                             </xsl:otherwise>
@@ -211,8 +279,34 @@
                     </xsl:when>
                     <xsl:when test="string-length($p5gnuplot:value)=0">
                         <xsl:comment>#155 going all </xsl:comment>
-                        
-                        <xsl:for-each-group select="current-group()[1]" group-by="parent::stentry/concat(@props,' ',@audience,' ',@group)"> <!-- stentry/p5gnuplot:stats -->
+                        <xsl:variable name="current-group.params">
+                            <foreign rev="#288 current-group.params">
+                                <xsl:copy-of select="ancestor-or-self::strow/@*[contains(name(),'param')]"/><!--  -->
+                            </foreign>
+                        </xsl:variable>
+                        <xsl:for-each-group select="current-group()[@props='group.sum' or @props='group.count']" group-by="parent::stentry/@audience"><!-- concat(@props,' ',@audience,' ',@group) --> <!-- stentry/p5gnuplot:stats -->
+                            <xsl:variable name="current-group.number">
+                                <current-group.number rev="{@rev}">
+                                    <xsl:for-each select="current-group()">
+                                        <xsl:if test="number(text())">
+                                            <number fid="{@fid}"><xsl:value-of select="number(text())"/></number>    
+                                        </xsl:if>
+                                    </xsl:for-each>
+                                    <xsl:for-each select="current-group()">
+                                        <xsl:sort select="number(text())" order="descending"/>
+                                        <xsl:if test="number(text())">
+                                            <number-max fid="{@fid}"><xsl:value-of select="number(text())"/></number-max>    
+                                        </xsl:if>
+                                    </xsl:for-each>
+                                </current-group.number>
+                            </xsl:variable>
+                            <!--<foreign rev="#299">
+                                <xsl:copy-of select="$current-group.number"/>
+                            </foreign>
+                            <foreign rev="#302 current-group current-grouping-key={current-grouping-key()} params={parent::*/@*/name()}">
+                                <!-\-<xsl:copy-of select="current-group()"/>-\->
+                                <xsl:copy-of select="$current-group.params"/>
+                            </foreign>-->
                             <dlentry rev="graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl#216 col={@col}  fids={@fid}" >
                                 <dt>
                                     poz. <xsl:value-of select="position()"/> <sup>(<xsl:value-of select="current-grouping-key()"/>)</sup> (<xsl:value-of select="position()"/>)
@@ -220,10 +314,18 @@
                                 <dd>
                                     min/max 
                                 </dd>
-                                
-                            <xsl:element name="dd">
-                                Suma <xsl:value-of select="system_cache__dita:big_values_format(sum(current-group()/number(text())))"/> 
-                            </xsl:element>
+                                <xsl:choose>                                    
+                                    <xsl:when test="$current-group.number//number-max[1]">
+                                        <xsl:element name="dd">
+                                            Suma <xsl:value-of select="system_cache__dita:big_values_format(sum($current-group.number//number))"/> <!--<xsl:value-of select="system_cache__dita:big_values_format(sum(current-group()/number(text())))"/>--> 
+                                        </xsl:element>
+                                    </xsl:when>
+                                    <xsl:otherwise>
+                                        <foreign rev="253-311 not found $current-group.number//number" props="values={current-group()/text()} count={count(current-group())} ">
+                                            <xsl:copy-of select="$current-group.number"/>
+                                        </foreign>
+                                    </xsl:otherwise>
+                                </xsl:choose>
                             <xsl:element name="dd">
                                 Ilość <xsl:value-of select="count(current-group()/number(text()))"/> 
                             </xsl:element>

+ 6 - 5
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl

@@ -118,6 +118,7 @@
     <xsl:import href="graph_gnuplot.xtics.xsd.param.xsl"/>
     <xsl:import href="graph_gnuplot.xsd.param.xsl"/>
     
+    
     <xsl:output indent="yes"/>
     <xsl:strip-space elements="*"/>
     
@@ -520,7 +521,7 @@ set y2label "</xsl:text><xsl:value-of select="$y2label"/><xsl:text>"
 #set xtics rotate  
 </xsl:text>
                     <xsl:value-of select="$p5gnuplot:logscale.y1"/>
-                    
+#debug 523                    
                     <xsl:call-template name="system_cache__dita:graph.gnuplot__x3A__from_ytics">
                         <xsl:with-param name="ytics" select="$ytics"/>
                         <xsl:with-param name="ylabel" select="$ylabel"/>
@@ -533,15 +534,15 @@ set y2label "</xsl:text><xsl:value-of select="$y2label"/><xsl:text>"
                         <xsl:with-param name="graph.newhistogram" select="$graph.newhistogram"/>
                         <xsl:with-param name="graph.color.name" select="$graph.color.name"/>
                     </xsl:call-template>
-                   
-                    
-                    
+#debug 536
                 </xsl:when>
                 <xsl:otherwise>
                     <xsl:text>set terminal pngcairo font "arial,</xsl:text><xsl:value-of select="$p5gnuplot:font__x3A__size"/>" size 800,600<xsl:text> 
 set nokey
 set output '</xsl:text><xsl:value-of select="$fileindex"/>.png'<xsl:text>
-set boxwidth 0.75
+#set boxwidth 0.75
+set boxwidth 1
+set boxwidth 2 relative
 set style fill solid
 set datafile missing "-"
 set title "</xsl:text><xsl:value-of select="$title"/><xsl:text>"

+ 17 - 4
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics.xsl

@@ -41,6 +41,7 @@
         <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="p5gnuplot:no.logscale.y2" required="yes" tunnel="yes"/>
         <xsl:param name="system_cache__dita:graph.separate.outputs.auto"/>
         
         <xtics fileindex="{$fileindex}">
@@ -133,6 +134,9 @@
                                                 <xsl:attribute name="xtics.pos__x3A__old_debug_to_off" select="$xtics//text[@col = current()/@col]/@pos"/>
                                                 <xsl:attribute name="group" select="$ytics/ytics/ytics.row/stentry[@col = current()/@col]/@group"/>
                                                 <xsl:attribute name="xtics.pos" select="system_cache__dita:graph.yaxis.pos($graph.title,$ytics,@current-grouping-key,@col)"/>
+                                                <xsl:variable name="group.context" select="$ytics/ytics/ytics.row/stentry[@col = current()/@col]/@audience"/>
+                                                <xsl:attribute name="system_cache__dita:graph.data.col__x3A__value.max" select="max($ytics/ytics/ytics.row/stentry[@audience = $group.context]/number(@system_cache__dita:graph.data.col__x3A__value))"/>
+                                                <xsl:attribute name="system_cache__dita:graph.data.col__x3A__value.count" select="count($ytics/ytics/ytics.row/stentry[@audience = $group.context]/number(@system_cache__dita:graph.data.col__x3A__value))"/>
                                                 <!--X3<xsl:copy-of select="@props"/>-->
                                                 <!--X3<xsl:copy-of select="@platform"/>-->
                                                 <xsl:choose>
@@ -257,6 +261,7 @@
         <xsl:param name="p5gnuplot:logscale.y2" required="yes" tunnel="yes"/>
         <xsl:param name="system_cache__dita:graph.separate.outputs.auto" required="yes" tunnel="yes"/>
         <p5gnuplot:graph.newhistogram>
+            <xsl:comment>#260 $p5gnuplot:logscale.y2=<xsl:value-of select="$p5gnuplot:logscale.y2"/>; $p5gnuplot:logscale.y2</xsl:comment>
             <xsl:call-template name="p5gnuplot:set.graph.style.histogram.rowstacked"/>
             <xsl:call-template name="p5gnuplot:set.xtics.rotate"/>
             <xsl:call-template name="p5gnuplot:set.xtics.unset"/>
@@ -309,8 +314,9 @@
         <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="p5gnuplot:no.logscale.y2" required="yes" tunnel="yes"/>
         <xsl:param name="system_cache__dita:graph.separate.outputs.auto" required="yes" tunnel="yes"/>
-        <xsl:comment>#72 @pos=<xsl:value-of select="@pos"/></xsl:comment>
+        <xsl:comment>#72 @pos=<xsl:value-of select="@pos"/> $p5gnuplot:logscale.y2=<xsl:value-of select="$p5gnuplot:logscale.y2"/>; $p5gnuplot:no.logscale.y2=<xsl:value-of select="$p5gnuplot:no.logscale.y2"/>;</xsl:comment>
         <p5gnuplot:plot p5gnuplot:text.join=" " debug="match graph.newhistogram">
             <xsl:variable name="current.current-grouping-key">
                 <current.current-grouping-key>
@@ -369,6 +375,11 @@
                             <!--<xsl:call-template name="p5gnuplot:set.graph.output">
                                 <xsl:with-param name="fileindex" select="$fileindex"/>
                             </xsl:call-template>-->
+                            <xsl:comment>#375 debug p5gnuplot:set.key begin</xsl:comment>
+                           <!-- <xsl:call-template name="p5gnuplot:set.key"/>
+                            <xsl:comment>#375 debug p5gnuplot:set.key end</xsl:comment>
+                            <xsl:call-template name="p5gnuplot:set.yrange"/>-->
+                            <!--<xsl:comment>#379 debug p5gnuplot:set.yrange end</xsl:comment>-->
                             <xsl:call-template name="p5gnuplot:set.graph.separate.outputs.auto">
                                 <xsl:with-param name="fileindex" select="$fileindex"/>
                                 <xsl:with-param name="position" select="count(preceding::graph.newhistogram)"/>
@@ -393,7 +404,9 @@
                 <xsl:when test="1=1 and audience[@current-grouping-key.foreign='false'] and string-length($test.following.current-grouping-key_x3A__different)=0 and @pos='1'">
                     <xsl:variable name="newhistogram.text"><xsl:value-of select="@graph.newhistogram.text"/><xsl:text> </xsl:text><xsl:for-each select="following-sibling::graph.newhistogram"> oraz: <xsl:value-of select="@graph.newhistogram.text"/></xsl:for-each></xsl:variable>
                     <!--<xsl:attribute name="p5gnuplot:text"> newhistogram "<xsl:value-of select="@graph.newhistogram.text"/> <xsl:for-each select="following-sibling::graph.newhistogram"> oraz: <xsl:value-of select="@graph.newhistogram.text"/></xsl:for-each>" </xsl:attribute>-->
-                    <xsl:attribute name="p5gnuplot:text"> newhistogram <xsl:value-of select="system_cache__dita:graph.lingstring__x3A__break(p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names($newhistogram.text,45),$system_cache__dita:graph.lingstring__x3A__break.size)"/> </xsl:attribute>
+                    <p5gnuplot:plot.text debug="#399">
+                        <xsl:attribute name="p5gnuplot:text"> newhistogram <xsl:value-of select="system_cache__dita:graph.lingstring__x3A__break(p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names($newhistogram.text,45),$system_cache__dita:graph.lingstring__x3A__break.size)"/> </xsl:attribute>
+                    </p5gnuplot:plot.text>
                 </xsl:when>
                 <!--<xsl:when test="1=1 and audience[@current-grouping-key.foreign='false']">
                     <xsl:comment>#146 bypassed  histograms</xsl:comment>
@@ -431,7 +444,7 @@
                             <xsl:attribute name="p5gnuplot:text.line.join"> , </xsl:attribute>
                         </xsl:when>
                     </xsl:choose>
-                    <p5gnuplot:newhistogram.child>
+                    <p5gnuplot:newhistogram.child debug="#444">
                         <xsl:attribute name="p5gnuplot:text"> newhistogram <xsl:value-of select="system_cache__dita:graph.lingstring__x3A__break(p5gnuplot:system_cache__dita__x3A__fix__x3A__axis__x3A__names(@graph.newhistogram.text,40),$system_cache__dita:graph.lingstring__x3A__break.size)"/> </xsl:attribute>
                     </p5gnuplot:newhistogram.child>
                     
@@ -551,7 +564,7 @@
             </xsl:call-template>
             <xsl:call-template name="p5gnuplot:file.row.color">
                 <xsl:with-param name="col" select="@col"/><!-- @xtics.pos -->
-                <xsl:with-param name="graph.color.variable" select="$graph.color.variable"/>
+                <xsl:with-param name="graph.color.variable" select="$graph.color.variable" tunnel="yes"/>
             </xsl:call-template>
             <xsl:call-template name="p5gnuplot:file.row.yaxis">
                 <xsl:with-param name="col" select="@col"/><!-- @xtics.pos -->

+ 13 - 4
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__detect.xsl

@@ -308,9 +308,17 @@
     <xsl:template name="p5gnuplot:logscale.y1__x3A__detect">
         <xsl:choose>
             <xsl:when test="contains(@props,'no.logscale.y1')"><!--<xsl:text>#set logscale y
-</xsl:text>--><xsl:message>#54-C-A p5gnuplot:logscale no.logscale</xsl:message></xsl:when>
+</xsl:text>--><xsl:message>#54-C-A p5gnuplot:logscale no.logscale for @id=<xsl:value-of select="@id"/></xsl:message></xsl:when>
             <xsl:when test="contains(@props,'logscale.y1')"><xsl:text>set logscale y
-</xsl:text><xsl:message>#54-C p5gnuplot:logscale</xsl:message></xsl:when>
+</xsl:text><xsl:message>#54-C p5gnuplot:logscale for @id=<xsl:value-of select="@id"/></xsl:message></xsl:when>
+            <xsl:otherwise/>
+        </xsl:choose>
+    </xsl:template>
+    
+    <xsl:template name="p5gnuplot:no.logscale.y2__x3A__detect">
+        <xsl:choose>
+            <xsl:when test="contains(@props,'no.logscale.y2')"><xsl:text>unset logscale y2
+</xsl:text><xsl:message>#54-321-C-A p5gnuplot:logscale no.logscale.y2 for @id=<xsl:value-of select="@id"/></xsl:message></xsl:when>
             <xsl:otherwise/>
         </xsl:choose>
     </xsl:template>
@@ -318,13 +326,14 @@
     <xsl:template name="p5gnuplot:logscale.y2__x3A__detect">
         <xsl:choose>
             <xsl:when test="contains(@props,'no.logscale.y2')"><!--<xsl:text>#set logscale y2
-</xsl:text>--><xsl:message>#54-C-A p5gnuplot:logscale no.logscale.y2</xsl:message></xsl:when>
+</xsl:text>--><xsl:message>#54-C-A p5gnuplot:logscale no.logscale.y2 for @id=<xsl:value-of select="@id"/></xsl:message></xsl:when>
             <xsl:when test="contains(@props,'logscale.y2')"><xsl:text>set logscale y2
-</xsl:text><xsl:message>#54-C p5gnuplot:logscale.y2</xsl:message></xsl:when>
+</xsl:text><xsl:message>#54-C p5gnuplot:logscale.y2 for @id=<xsl:value-of select="@id"/></xsl:message></xsl:when>
             <xsl:otherwise/>
         </xsl:choose>
     </xsl:template>
     
+    
     <xsl:template name="system_cache__dita:graph.unset.xtics__x3A__detect">
         <xsl:choose>
             <xsl:when test="contains(@props,'graph.unset.xtics')"><xsl:text>

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

@@ -29,7 +29,7 @@
         <xsl:apply-templates mode="#current"/><!-- just bypass -->
     </xsl:template>
     
-    <xsl:template mode="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable" match="*[descendant-or-self::simpletable and not(name()='SIMPLETABLE_WTITLE')]|simpletable">
+    <xsl:template mode="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable" match="*[descendant-or-self::simpletable and not(name()='SIMPLETABLE_WTITLE')]|simpletable|system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new">
         <xsl:copy>
             <xsl:copy-of select="@*"/>
             <xsl:apply-templates mode="#current"/>

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

@@ -17,7 +17,8 @@
     <xsl:template mode="p5gnuplot:graph.newhistogram__x3A__plot" match="text()|comment()"/>
     
     <xsl:template mode="p5gnuplot:graph.newhistogram__x3A__plot" match="p5gnuplot:graph.newhistogram">
-        <xsl:text>#20 mode="p5gnuplot:graph.newhistogram__x3A__plot" match </xsl:text><xsl:value-of select="name()"/><xsl:text>
+        <xsl:text>
+            #20 mode="p5gnuplot:graph.newhistogram__x3A__plot" match </xsl:text><xsl:value-of select="name()"/><xsl:text>
             
 </xsl:text>
         <xsl:apply-templates mode="#current" select="@*"/>

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

@@ -70,7 +70,7 @@
         <xsl:when test="p5gnuplot:detect.histogram.groups__x3A__count($graph.newhistogram) &gt;1">
             <xsl:attribute name="p5gnuplot:text.join"><xsl:text>
 </xsl:text></xsl:attribute>
-            <xsl:attribute name="p5gnuplot:text">#set xtics rotate</xsl:attribute>
+            <xsl:attribute name="p5gnuplot:text">set xtics rotate</xsl:attribute>
         </xsl:when>
         <xsl:when test="system_cache__dita:graph.xtics.color.column($xtics)=3 or count(descendant::audience)=1 or count(descendant::p5gnuplot:plot[@p5gnuplot:text]) &lt;= 1">
             <xsl:attribute name="p5gnuplot:text.join"><xsl:text>
@@ -208,6 +208,7 @@
     
     <xsl:template name="p5gnuplot:set.logscale.y2">
         <xsl:param name="p5gnuplot:logscale.y2" required="yes" tunnel="yes"/>
+        <xsl:param name="p5gnuplot:no.logscale.y2" required="yes" tunnel="yes"/>
         <p5gnuplot:set.logscale.y2>
             <xsl:choose>
                 <xsl:when test="string-length($p5gnuplot:logscale.y2) &gt;0">
@@ -216,6 +217,11 @@
                     <xsl:attribute name="p5gnuplot:text" select="$p5gnuplot:logscale.y2"/>
                     <xsl:attribute name="p5gnuplot:value" select="$p5gnuplot:logscale.y2"/>
                 </xsl:when>
+                <xsl:when test="string-length($p5gnuplot:no.logscale.y2) &gt;0">
+                    <xsl:attribute name="p5gnuplot:text.join"><xsl:text>
+</xsl:text></xsl:attribute>
+                    <xsl:attribute name="p5gnuplot:text">#set logscale y2 - offset by $p5gnuplot:no.logscale.y2 row.222</xsl:attribute>
+                </xsl:when>
                 <xsl:otherwise>
                     <xsl:attribute name="p5gnuplot:text.join"><xsl:text>
 </xsl:text></xsl:attribute>
@@ -231,6 +237,13 @@
         <p5gnuplot:set.yrange>
             
             <xsl:choose>
+                <xsl:when test="descendant-or-self::current-grouping-key/@system_cache__dita:graph.data.col__x3A__value.max">
+                    <xsl:variable name="p5gnuplot:file.row.y" select="descendant-or-self::current-grouping-key/@system_cache__dita:graph.data.col__x3A__value.max"/>
+                    <xsl:attribute name="debug.file.row.y" ><xsl:value-of select="$p5gnuplot:file.row.y"/> todo max(not works)</xsl:attribute>
+                    <xsl:attribute name="p5gnuplot:text.join"><xsl:text>
+</xsl:text></xsl:attribute>
+                    <xsl:attribute name="p5gnuplot:text">set yrange [0:*] </xsl:attribute>
+                </xsl:when>
                 <xsl:when test="$ytics//stentry[ @system_cache__dita:graph.yaxis.value='1' ]/@system_cache__dita:graph.data.col__x3A__value">
                     <xsl:attribute name="p5gnuplot:text.join"><xsl:text>
 </xsl:text></xsl:attribute>
@@ -263,7 +276,7 @@
     <xsl:template name="p5gnuplot:set.graph.separate.outputs.auto">
         <xsl:param name="position" required="yes"/>
         <xsl:param name="fileindex" required="yes"/>
-        <p5gnuplot:set.graph.separate.outputs.auto debug="test multi out" >
+        <p5gnuplot:set.graph.separate.outputs.auto debug="test multi out 272" >
             <xsl:attribute name="p5gnuplot:position" select="$position"/>
             
             <xsl:attribute name="p5gnuplot:value"><xsl:value-of select="$fileindex"/>.<xsl:value-of select="$position"/>.png</xsl:attribute>
@@ -274,6 +287,10 @@
                 <xsl:copy-of select="descendant-or-self::system_cache__dita:graph.col__x3A__if_not_empty[@system_cache__dita:graph.col__x3A__if_not_empty='' and @graph.yaxis='x1y2']"/>
             </p5gnuplot:all_points_y2_value_undefined__x3A__detect>-->
             <xsl:call-template name="p5gnuplot:all_points_y2_value_undefined__x3A__detect"/>
+            <xsl:comment>#283 context/n=<xsl:value-of select="name()"/> ; group/n=<xsl:value-of select="descendant-or-self::current-grouping-key/@group"/></xsl:comment>
+            <xsl:call-template name="p5gnuplot:set.yrange"/>
+            <xsl:comment>#283-E descendant-or-self::*/n = <xsl:value-of select="descendant-or-self::*/name()"/></xsl:comment>
+            <xsl:comment>#283-M system_cache__dita:graph.data.col__x3A__value.max= <xsl:value-of select="descendant-or-self::current-grouping-key/@system_cache__dita:graph.data.col__x3A__value.max"/>; <xsl:value-of select="descendant-or-self::current-grouping-key/@system_cache__dita:graph.data.col__x3A__value.count"/></xsl:comment>
             <p5gnuplot:set.newline>
                 <xsl:attribute name="p5gnuplot:text.join"><xsl:text>
 </xsl:text></xsl:attribute>

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

@@ -528,7 +528,13 @@
         <xsl:choose>
             <xsl:when test="$xtics//p5gnuplot:graph.newhistogram">
                 <xsl:message>#273 parsing graph via template p5gnuplot:graph.newhistogram</xsl:message>
+                <xsl:text>
+                    #273-begin parsing graph via template p5gnuplot:graph.newhistogram $xtics//p5gnuplot:graph.newhistogram mode="p5gnuplot:graph.newhistogram__x3A__plot"
+                </xsl:text>
                 <xsl:apply-templates mode="p5gnuplot:graph.newhistogram__x3A__plot" select="$xtics//p5gnuplot:graph.newhistogram"/>
+                <xsl:text>
+                    #273-eof parsing graph via template p5gnuplot:graph.newhistogram $xtics//p5gnuplot:graph.newhistogram mode="p5gnuplot:graph.newhistogram__x3A__plot"
+                </xsl:text>
             </xsl:when>
             <xsl:otherwise>
                 <xsl:for-each select="1 to xs:integer(count($xtics//text))">

+ 17 - 8
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.yaxis.standalone.xsl

@@ -4,7 +4,10 @@
     xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
     xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
     xmlns: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"
+        
+    
     exclude-result-prefixes="xs"
     version="2.0">
     
@@ -13,27 +16,33 @@
     <xsl:output indent="yes"/>
     <xsl:strip-space elements="*"/>
     
-    <xsl:import href="../tree_to_dita.xsl"/>
+    <xsl:import href="graph_gnuplotdat.row__x3A__from__xtics.xsl"/>
+    
+    <xsl:include href="../tree_to_dita.xsl"/>
+    
+    
     
     <xsl:param name="p5gnuplot:input.standalone.prefix" select="'BI_audit_ENERGA_PRACOWNICY_APU4_umowy_APU4-DPW_BI_audit_ENERGA_PRACOWNICY.65424'"/>
     <xsl:param name="p5gnuplot:input.standalone.dir" select="'/opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-1415_000001/graph_to_image/'"/>
     
     
     
-    <xsl:variable name="graph.color.variable" select="doc(concat($p5gnuplot:input.standalone.dir,$p5gnuplot:input.standalone.prefix,'.graph.color.variable.xml'))"/>
+    
+    
+    <!--<xsl:variable name="graph.color.variable" select="doc(concat($p5gnuplot:input.standalone.dir,$p5gnuplot:input.standalone.prefix,'.graph.color.variable.xml'))"/>-->
     
     
     
-    <xsl:template mode="p5gnuplot:graph.newhistogram__x3A__plot" match="p5gnuplot:xtics">
+    <!--<xsl:template mode="p5gnuplot:graph.newhistogram__x3A__plot" match="p5gnuplot:xtics">
         <xsl:copy>
         <xsl:apply-templates mode="p5gnuplot:graph.newhistogram__x3A__plot" select="descendant-or-self::p5gnuplot:graph.newhistogram"/>
         </xsl:copy>
-    </xsl:template>
+    </xsl:template>-->
     
     
-    <xsl:template name="system_cache__dita:graph.dat.row__x3A__from__ytics.path.row.xml.standalone">
+    <!--<xsl:template name="system_cache__dita:graph.dat.row__x3A__from__ytics.path.row.xml.standalone">
         
-        <!--<xsl:call-template name="system_cache__dita:graph.gnuplot__x3A__from_ytics">
+        <!-\-<xsl:call-template name="system_cache__dita:graph.gnuplot__x3A__from_ytics">
             <xsl:with-param name="ytics" select="doc(concat($p5gnuplot:input.standalone.dir,$p5gnuplot:input.standalone.prefix,'gnuplot.debug.ytics.xml'))/p5gnuplot:graph.ytics"/>
             <xsl:with-param name="ylabel" select="doc(concat($p5gnuplot:input.standalone.dir,$p5gnuplot:input.standalone.prefix,'gnuplot.debug.ylabel.xml'))"/>
             <xsl:with-param name="graph.headers" select="doc(concat($p5gnuplot:input.standalone.dir,$p5gnuplot:input.standalone.prefix,'gnuplot.debug.graph.headers.xml'))"/>
@@ -45,9 +54,9 @@
             <xsl:with-param name="graph.newhistogram" select="doc(concat($p5gnuplot:input.standalone.dir,$p5gnuplot:input.standalone.prefix,'.gnuplot.debug.graph.newhistogram.xml'))"/>
             <xsl:with-param name="graph.color.name" select="doc(concat($p5gnuplot:input.standalone.dir,$p5gnuplot:input.standalone.prefix,'.graph.color.name.xml'))"/>
             <xsl:with-param name="graph.color.variable" select="doc(concat($p5gnuplot:input.standalone.dir,$p5gnuplot:input.standalone.prefix,'.graph.color.variable.xml'))" tunnel="yes"/>
-        </xsl:call-template>-->
+        </xsl:call-template>-\->
         
-    </xsl:template>
+    </xsl:template>-->
     
     
     

+ 9 - 0
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat__x3A__init.xsl

@@ -73,9 +73,17 @@
         <xsl:variable name="p5gnuplot:logscale.y1">
             <xsl:call-template name="p5gnuplot:logscale.y1__x3A__detect"/>
         </xsl:variable>
+        
+        <xsl:variable name="p5gnuplot:no.logscale.y2">
+            <xsl:call-template name="p5gnuplot:no.logscale.y2__x3A__detect"/>
+        </xsl:variable>
+        
+        
         <xsl:variable name="p5gnuplot:logscale.y2">
             <xsl:call-template name="p5gnuplot:logscale.y2__x3A__detect"/>
         </xsl:variable>
+        
+        
         <!-- do stworzenia grafu na bazie tabeli simpletable w dita -->
         <xsl:variable name="fileindex" >
             <xsl:call-template name="system_cache__dita:graph.fileindex__x3A__detect"/>
@@ -184,6 +192,7 @@
                 <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="p5gnuplot:no.logscale.y2" select="$p5gnuplot:no.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>

+ 784 - 137
SE/schema/default_db_xml_cache.public/default_db/system_cache__dita__x3A__p5gnuplot/system_cache__dita__x3A__p5gnuplot.interface.xsl

@@ -26,63 +26,96 @@
 
     <!-- @2019-09 0 cel aby efektywnie z kontekstu struktur tworzyc obiekty wykresow -->
     
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.interface.for-each-group.child">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.current-group"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order" select="'ascending'"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type" select="'number'"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.current-group">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.current-group" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.current-group"/>
+        </xsl:if>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type"/>
+    </xsl:template>
+    
     <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root"
         name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root" 
         match="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root">
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.fallback.mode"  select="@system_cache__dita__x3A__p5gnuplot:interface.fallback.mode"/><!-- jakim modem ma modul wyrzic spowrotem - z listy -->
         <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child_flag"/>--><!-- czy podwojnie robic w dol -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.current-group" select="@system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.current-group"/>
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute" select="@system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute"/>
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute" /><!-- select="@system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute" -->
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order" select="@system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order"/>
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type" select="@system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type"/>
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" tunnel="yes"/><!--like select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset/*/*" -->
+        <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" required="yes" tunnel="yes"/>-->
         <xsl:variable name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context" select="*"/>
         <xsl:message>#37 system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root run</xsl:message>
         <xsl:variable name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute" select="@system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute"/>
-        
-        <xsl:copy>
-            <xsl:copy-of select="@*"/>
-        <xsl:comment>#37 system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root run  
+        <xsl:comment>#37 n/=<xsl:value-of select="name()"/> @debug.row=<xsl:value-of select="@debug.row"/></xsl:comment>
+        <!--<xsl:copy>
+            <xsl:copy-of select="@*"/>-->
+        <!--<xsl:comment>#37 system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root run  
             $system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable/n =<xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable/name()[1]"/>
             $system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute = [ <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute"/> ]
             @system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute = [[<xsl:value-of select="@system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute"/>]]
             TEST_SEARCH =[[ <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable/*[ @*[ name()=$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute ] ]"/> ]]
-        </xsl:comment>
+        </xsl:comment>-->
             <xsl:choose>
                 <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable">
-                        <xsl:for-each-group select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" group-by="@*[ name()=$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute ]">
-                            <xsl:sort select="@*[ name()=$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute ]" order="{$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order}"/>
-                            <foreigh rev="#366 $system_cache__dita__x3A__p5gnuplot:interface.fallback.mode = {$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode}  n/={name()}">
-                            <xsl:choose>
-                                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode='system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new'">
+                    <xsl:choose>
+                        <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.current-group">
+                            <xsl:for-each-group select="current-group()" group-by="@*[ name()=$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute ]">
+                                <xsl:sort select="@*[ name()=$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute ]" order="{$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order}"/>
+                                <xsl:comment>#366-75-current-group</xsl:comment>
+                                <xsl:apply-templates mode="#current" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" select="." tunnel="yes"/>
+                                </xsl:apply-templates>
+                               
+                            </xsl:for-each-group>
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:for-each-group select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" group-by="@*[ name()=$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.by.attribute ]">
+                                <xsl:sort select="@*[ name()=$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.attribute ]" order="{$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order}"/>
+                                <!--<foreigh rev="#366-55 $system_cache__dita__x3A__p5gnuplot:interface.fallback.mode = {$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode}  n/={name()}">-->
+                                <xsl:comment>#366-55</xsl:comment>
+                                <!--<xsl:choose>-->
+                                <!--<xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode='system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new'">
                                     <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context">
                                         <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable.context" select="." tunnel="yes"/>
                                     </xsl:apply-templates>
-                                </xsl:when>
-                                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode/text()">
+                                </xsl:when>-->
+                                <!--<xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode/text()">
                                     <system_cache__dita__x3A__p5gnuplot:interface.fallback.mode>#36</system_cache__dita__x3A__p5gnuplot:interface.fallback.mode>
-                                </xsl:when>
+                                </xsl:when>-->
                                 
-                                <xsl:otherwise>
-                                    <xsl:apply-templates mode="#current" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context">
-                                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable.context" select="." tunnel="yes"/>
-                                    </xsl:apply-templates>
-                                    <!--<xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new">
+                                <!--<xsl:otherwise>-->
+                                <xsl:apply-templates mode="#current" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context">
+                                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" select="." tunnel="yes"/>
+                                </xsl:apply-templates>
+                                <!--<xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new">
                                         <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context"/>
                                     </xsl:apply-templates>-->
-                                </xsl:otherwise>
-                            </xsl:choose>
-                        
-                    </foreigh>
-                        </xsl:for-each-group>
+                                <!--</xsl:otherwise>-->
+                                <!--</xsl:choose>-->
+                                
+                                <!--</foreigh>-->
+                            </xsl:for-each-group>
+                        </xsl:otherwise>
+                    </xsl:choose>
+                    
                 </xsl:when>
                 <xsl:otherwise>
-                    <foreign rev="{name()}">
+                    <foreign rev="#366-80 $system_cache__dita__x3A__p5gnuplot:interface.fallback.mode = {$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode}  n/={name()}">
                         
                     </foreign>
                 </xsl:otherwise>
             </xsl:choose>
-        </xsl:copy>
+        <!--</xsl:copy>-->
         <!--<xsl:choose>
             <xsl:when test="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child>
                    
@@ -111,13 +144,15 @@
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order" select="@system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.order"/>
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type" select="@system_cache__dita__x3A__p5gnuplot:interface.for-each-group.child.sort.data-type"/>
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" tunnel="yes"/><!--like select="$default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.childs.attrs.nodeset/*/*" -->
-        <xsl:variable name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context" select="*"/>
+        <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context" required="yes" tunnel="yes" />--><!-- select="*" -->
+        <xsl:variable name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context" select="."/>
         <xsl:choose>
             <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable/*">
                
-                    <foreigh rev="#99">
-                        <xsl:choose>
-                            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode='system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new'">
+                    <!--<foreigh rev="#99 name={name()}">-->
+                <xsl:comment> rev="#99 name=<xsl:value-of select="name()"/>;</xsl:comment>
+                        <!--<xsl:choose>-->
+                            <!--<xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode='system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new'">
                                 <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new">
                                     <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context"/>
                                 </xsl:apply-templates>
@@ -125,13 +160,13 @@
                             <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.fallback.mode/text()">
                                 <system_cache__dita__x3A__p5gnuplot:interface.fallback.mode>#36</system_cache__dita__x3A__p5gnuplot:interface.fallback.mode>
                             </xsl:when>
-                            <xsl:otherwise>
-                                <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new">
+                            <xsl:otherwise>-->
+                                <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable">
                                     <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context"/>
                                 </xsl:apply-templates>
-                            </xsl:otherwise>
-                        </xsl:choose>
-                </foreigh>
+                            <!--</xsl:otherwise>-->
+                        <!--</xsl:choose>-->
+                <!--</foreigh>-->
             </xsl:when>
         </xsl:choose>
         
@@ -159,27 +194,96 @@
     
     
     <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root" match="@system_cache__dita__x3A__p5gnuplot:graph.ylabel.wartosc[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
-        <xsl:value-of select="text()"/><xsl:text> </xsl:text>
+        <xsl:value-of select="."/><xsl:text> </xsl:text>
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root" match="@system_cache__dita__x3A__p5gnuplot:graph.y2label.wartosc[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
+        <xsl:value-of select="."/><xsl:text> </xsl:text>
     </xsl:template>
     
     <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" match="@system_cache__dita__x3A__p5gnuplot:no.logscale.y1[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
-        <xsl:value-of select="text()"/><xsl:text> </xsl:text>
+        <xsl:value-of select="."/><xsl:text> </xsl:text>
     </xsl:template>
     <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" match="@system_cache__dita__x3A__p5gnuplot:no.logscale.y2[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
-        <xsl:value-of select="text()"/><xsl:text> </xsl:text>
+        <xsl:value-of select="."/><xsl:text> </xsl:text>
     </xsl:template>
-    <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" match="@system_cache__dita__x3A__p5gnuplot:graph.style.histogram.rowstacked[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
-        <xsl:value-of select="text()"/><xsl:text> </xsl:text>
+    <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" match="@system_cache__dita__x3A__p5gnuplot:graph.style[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
+        <!--<xsl:choose>
+            <xsl:when test="../@"></xsl:when>
+        </xsl:choose>-->
+        <xsl:value-of select="."/><xsl:text> </xsl:text>
     </xsl:template>
-    <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" match="@system_cache__dita__x3A__p5gnuplot:font15[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
-        <xsl:value-of select="text()"/><xsl:text> </xsl:text>
+    <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" match="@system_cache__dita__x3A__p5gnuplot:font[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
+        <xsl:value-of select="."/><xsl:text> </xsl:text>
     </xsl:template>
-    <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" match="@system_cache__dita__x3A__p5gnuplot:nograph[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
-        <xsl:value-of select="text()"/><xsl:text> </xsl:text>
+
+    <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" match="@system_cache__dita__x3A__p5gnuplot:nograph"><!-- [parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new] -->
+        <xsl:value-of select="."/><xsl:text> </xsl:text>
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" match="@system_cache__dita__x3A__p5gnuplot:graph.separate.outputs.auto"><!-- [parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new] -->
+        <xsl:value-of select="."/><xsl:text> </xsl:text>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:graph.separate.outputs.auto">
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.separate.outputs.auto"> graph.separate.outputs.auto </xsl:attribute>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:no.logscale.y2">
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:no.logscale.y2"> no.logscale.y2 </xsl:attribute>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:no.logscale.y1">
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:no.logscale.y1"> no.logscale.y1 </xsl:attribute>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:graph.style">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.style.histogram"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.style.histogram.rowstacked"/>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:graph.style.histogram">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.style"> graph.style.histogram </xsl:attribute>        
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:graph.style.histogram.rowstacked">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.style"> graph.style.histogram.rowstacked </xsl:attribute>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:message terminate="yes">#249 ERROR not set one of $system_cache__dita__x3A__p5gnuplot:graph.style.histogram $system_cache__dita__x3A__p5gnuplot:graph.style.histogram.rowstacked</xsl:message>
+            </xsl:otherwise>
+        </xsl:choose>
+        
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:graph.y2label">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.y2label" select="'wartosc'"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.y2label"> graph.y2label.<xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:graph.y2label"/> </xsl:attribute>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:graph.ylabel">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.ylabel" select="'Y'"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.ylabel"> graph.ylabel.<xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:graph.ylabel"/> </xsl:attribute>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:font">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:font9"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:font15"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:font30"/>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:font9">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:font" select="' font9 '"/>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:font15">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:font" select="' font15 '"/>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:font30">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:font" select="' font30 '"/>
+            </xsl:when>
+        </xsl:choose>
+        
     </xsl:template>
     
     <xsl:template name="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props.nograph">
-        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:nograph"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:nograph" select="' nograph '"/>
     </xsl:template>
     
     <xsl:template mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable" match="@p5gnuplot:frame[parent::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new]">
@@ -193,7 +297,11 @@
     <xsl:template name="system_cache__dita__x3A__p5gnuplot:interface.simpletable" >
         <xsl:attribute name="props">
             <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable.props" select="@*" />
+            <!--<xsl:for-each select="@*">n=<xsl:value-of select="name()"/>=<xsl:value-of select="."/>; </xsl:for-each>-->
         </xsl:attribute>
+        <!--<xsl:attribute name="props.debug3">
+            <xsl:for-each select="@*">n=<xsl:value-of select="name()"/>=<xsl:value-of select="."/>; </xsl:for-each>
+        </xsl:attribute>-->
         <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.simpletable" select="@*"/>
     </xsl:template>
     
@@ -202,13 +310,16 @@
         match="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new">
         <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" tunnel="yes"/>-->
             <!--<xsl:variable name="system_cache__dita__x3A__p5gnuplot:SIMPLETABLE_WTITLE">-->
-                    <system_cache__dita__x3A__p5gnuplot:SIMPLETABLE_WTITLE>
+        <simpletable>
+                    <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.simpletable.new">debug 210</xsl:attribute>
                         <!--<xsl:attribute name="debug.var" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable/name()[1]"/>-->
-                        <foreign>
+                        <!--<foreign >-->
+                            <!--<xsl:attribute name="props">graph.ylabel.Y graph.y2label.wartosc graph.style.histogram graph.style.histogram  no.logscale.y1 no.logscale.y2 font9 graph.separate.outputs.auto  default_db__x3A__BI_audit_BENFORD:CostField</xsl:attribute>-->        
                             <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:interface.simpletable"/>
+                        <xsl:comment>debug="207"</xsl:comment>
                             <xsl:apply-templates mode="#current"/>
-                        </foreign>
-                    </system_cache__dita__x3A__p5gnuplot:SIMPLETABLE_WTITLE>
+                        <!--</foreign>-->
+                    </simpletable>
             <!--</xsl:variable>-->
         <!--<xsl:apply-templates select="$system_cache__dita__x3A__p5gnuplot:SIMPLETABLE_WTITLE" 
             mode="system_cache__dita:graph.all.data.fit.fix__x3A__numerate.simpletable" />-->
@@ -220,19 +331,43 @@
     <xsl:template name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new"
         mode="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root" 
         match="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" tunnel="yes" required="yes"/>
+        <!--<xsl:param name="system_cache__dita:context.path.attrs.nodeset" tunnel="yes" />-->
         <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" tunnel="yes"/>-->
-        <strow props="graph.headers">
-            <xsl:attribute name="childs"><xsl:for-each select="*"><xsl:value-of select="name()"/> </xsl:for-each></xsl:attribute>
-            <xsl:apply-templates mode="#current">
-                <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" select="'graph.headers'" tunnel="yes"/>
-            </xsl:apply-templates>
-            <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root"/>
-        </strow>
-        <strow props="graph.data">
-            <xsl:apply-templates mode="#current">
-                <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" select="'graph.data'" tunnel="yes"/>
-            </xsl:apply-templates>
-        </strow>
+        
+            <strow props="graph.headers">
+                <xsl:attribute name="childs"><xsl:for-each select="*"><xsl:value-of select="name()"/> </xsl:for-each></xsl:attribute>
+                <xsl:apply-templates mode="#current">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" select="'graph.headers'" tunnel="yes"/>
+                </xsl:apply-templates>
+                <xsl:apply-templates mode="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root"/>
+            </strow>
+            <strow props="graph.data">
+                <xsl:apply-templates mode="#current">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" select="'graph.data'" tunnel="yes"/>
+                </xsl:apply-templates>
+            </strow>
+        <xsl:choose>
+            
+            <xsl:when test="@system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.stats">
+                <xsl:call-template name="p5gnuplot:simpletable__x3A__graph.stats">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable"  tunnel="yes"/> <!-- $system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable/parent::*/parent::* -->                       
+                    <!-- <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                            <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                            <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>-->
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="@default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:ValueType" select="@default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                    <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="@p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+                    <xsl:with-param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="@p5gnuplot:simpletable__x3A__graph.stats.group_by"/>
+                    <xsl:with-param name="audience" select="@system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/>
+                    <xsl:with-param name="group.root" select="@system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root"/><!--koszt.</xsl:with-param>-->
+                    <xsl:with-param name="group.count" select="@system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count"/><!--iloscB.</xsl:with-param>-->
+                    <xsl:with-param name="group.sum" select="@system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum"/><!--kosztB.</xsl:with-param>-->
+                </xsl:call-template>
+            </xsl:when>
+        </xsl:choose>
+        
             <strow props="graph.title">
                 <xsl:apply-templates mode="#current">
                     <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" select="'graph.title'" tunnel="yes"/>
@@ -248,16 +383,28 @@
                     <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" select="'graph.yaxis'" tunnel="yes"/>
                 </xsl:apply-templates>
             </strow>
-                <strow props="graph.fill.style">
-                    <xsl:apply-templates mode="#current">
-                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" select="'graph.fill.style'" tunnel="yes"/>
-                    </xsl:apply-templates>
-                </strow>
+            <strow props="graph.fill.style">
+                <xsl:apply-templates mode="#current">
+                    <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" select="'graph.fill.style'" tunnel="yes"/>
+                </xsl:apply-templates>
+            </strow>
+        
+        <!--<xsl:choose>-->
+            <!--<xsl:when test="descendant-or-self::system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.strow.new[@system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc]">-->
                 <strow props="graph.newhistogram">
                     <xsl:apply-templates mode="#current">
                         <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" select="'graph.newhistogram'" tunnel="yes"/>
                     </xsl:apply-templates>
                 </strow>
+            <!--</xsl:when>-->
+            <!--<xsl:otherwise>
+                <xsl:comment>#392 not declared params for graph.newhistogram - bypassed strow</xsl:comment>
+                <!-\-<strow props="graph.newhistogram">
+                    <stentry audience="wartosc" > analiza </stentry>
+                </strow>-\->
+            </xsl:otherwise>-->
+        <!--</xsl:choose>-->
+        
                 
         <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.temporary"/>
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:strow.new" required="yes"/><!-\- nowy wiersz -\->-->
@@ -267,89 +414,271 @@
     
     
     
-    <xsl:template name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new" mode="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new" match="*">
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new" 
+        mode="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.stentry.new" match="*">
         <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.debug"/>-->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable.context" tunnel="yes"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context" required="yes"/>
+        <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable" tunnel="yes"/>-->
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.strow.props.name" required="no" tunnel="yes"/><!-- ? props="graph.headers" -->
         
         <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.temporary"/>-->
         <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:stentry.new" required="yes"/>-->  
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/><!--  col="1">2013|3</sten -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc"/><!--  col="1">2013|3</sten -->
+                                                                                                                                                                          
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/><!-- w @props="graph.stats" jest inaczej   props="group.sum" current-grouping-key="100000.0" audience="rozklad_100000.0" group="kosztB.2013|3"-->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc"/><!-- no more foud -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc"/>
         
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/><!-- w @props="graph.stats" jest inaczej   props="group.sum" current-grouping-key="100000.0" audience="rozklad_100000.0" group="kosztB.2013|3"-->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/><!-- no more foud -->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/><!-- current-grouping-key="2013|3" -->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/><!-- only title current-grouping-key="2013|3" group="koszt 2013|3" audience="rozklad_2013|3" col="2">koszt U.100000.0 -->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/><!-- current-grouping-key="2013|3" -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc"/><!-- only title current-grouping-key="2013|3" group="koszt 2013|3" audience="rozklad_2013|3" col="2">koszt U.100000.0 -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>
         
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.title.text.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot.graph.title.text.uniq.desc"/><!-- group="ilosc 2013|3" audience="rozklad_2013|3" col="1">ilość U.2013|3</stent -->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.title.time.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot.graph.title.time.uniq.desc" /><!-- blad?  koszt U.100000.0; ilość U.2014|1;koszt U.1000000.0  -->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.title.string.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot.graph.title.string.uniq.desc" />
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.color.name.text" select="@system_cache__dita__x3A__p5gnuplot.graph.color.name.text" /><!-- todo options blue,red -->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"  select="@system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"/><!-- col="2">2</ste -->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc" select="@system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc"/><!-- todo options -->
-        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.newhistogram.string.uniq.desc" select="@system_cache__dita__x3A__p5gnuplot.graph.newhistogram.string.uniq.desc" />
-        <xsl:element name="stentry">
-            <xsl:attribute name="rev"> debug #290 name/= <xsl:value-of select="name()"/>; $system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable.context/n = [<xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.input.variable.context/name()"/>] </xsl:attribute>
-            <xsl:attribute name="props" select="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name"/>
-            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:audience.string">
-                <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc">
-                    <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/>
-                </xsl:if>
-                <xsl:if test="$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc">
-                    <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc"/>
-                </xsl:if>
-            </xsl:variable>
-            <xsl:if test="string-length($system_cache__dita__x3A__p5gnuplot:audience.string)&gt;0">
-                <xsl:attribute name="audience" select="$system_cache__dita__x3A__p5gnuplot:audience.string"/>
-            </xsl:if>
-            
-            <xsl:if test="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc">
-                <xsl:attribute name="current-grouping-key" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
-            </xsl:if>
-            
-            <xsl:variable name="system_cache__dita__x3A__p5gnuplot:group.string">
-                <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc">
-                    <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc"/>
-                </xsl:if>
-                <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc">
-                    <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>
-                </xsl:if>
-            </xsl:variable>
-            
-            <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.title.text.uniq.desc">
-                <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.title.text.uniq.desc"/>
-            </xsl:if>
-            <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.title.time.uniq.desc">
-                <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.title.time.uniq.desc"/>
-            </xsl:if>
-            <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.title.string.uniq.desc">
-                <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.title.string.uniq.desc"/>
-            </xsl:if>
-            <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.color.name.text">
-                <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.color.name.text"/>
-            </xsl:if>
-            
-            <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.yaxis.int">
-                <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"/>
-            </xsl:if>
-            
-            <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc">
-                <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc"/>
-            </xsl:if>
-            
-            <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.newhistogram.string.uniq.desc">
-                <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.newhistogram.string.uniq.desc"/>
-            </xsl:if>
-            
-            
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc"/>
+        
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.title.text.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.title.text.uniq.desc"/><!-- group="ilosc 2013|3" audience="rozklad_2013|3" col="1">ilość U.2013|3</stent -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.title.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.title.time.uniq.desc" /><!-- blad?  koszt U.100000.0; ilość U.2014|1;koszt U.1000000.0  -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.title.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.title.string.uniq.desc" />
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.color.name.text" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.color.name.text" /><!-- todo options blue,red -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"  select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"/><!-- col="2">2</ste -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc"/><!-- todo options -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.title" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.fill.style.title"/><!-- todo options -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle"/><!-- todo options -->
+        
+        <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.newhistogram.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot.graph.newhistogram.string.uniq.desc" />-->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute"/>
+        
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:value.sum.attribute"/>
+        
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:value.count" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:value.count"/>
+        
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc"/>
+        
+                    
+                <!--<xsl:copy-of select="@*"/>-->
+            <!--<xsl:attribute name="rev"> debug #290 name/= <xsl:value-of select="name()"/>; $$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name="<xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name"/>"; $system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/n=<xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/name()"/> </xsl:attribute>-->
+            <!--<xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@*"></xsl:copy-of>-->
             <xsl:choose>
-                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc">
-                    <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/>
+                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name='graph.headers'">
+                    <!--<xsl:attribute name="current-grouping-key">
+                        <!-\-<xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>-\->
+                        <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc]"/>
+                    </xsl:attribute>-->
+                    <xsl:element name="stentry">
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                        </xsl:call-template>
+                        <xsl:attribute name="props">graph.xtic</xsl:attribute>
+                        <!--<xsl:attribute name="audience">
+                            <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/>
+                            <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc]"/>
+                        </xsl:attribute>-->
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.audience">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc"/>
+                        </xsl:call-template>
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.platform">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute" select="$system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute"/>
+                        </xsl:call-template>
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.header">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc"/>
+                        </xsl:call-template>
+                        <!--<xsl:choose>
+                            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc">
+                                <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc]"/> 
+                            </xsl:when>
+                            <xsl:otherwise>
+                                <xsl:message>#325 ERROR not required expected @system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc</xsl:message>
+                            </xsl:otherwise>
+                        </xsl:choose>-->
+                    </xsl:element>
+                </xsl:when>
+                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name='graph.data'">
+                    <!--<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                    </xsl:call-template>--> 
+                    <xsl:element name="stentry">
+                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                    </xsl:call-template>
+                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.audience">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc"/>
+                    </xsl:call-template>
+                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:value">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute" select="$system_cache__dita__x3A__p5gnuplot:value.sum.attribute"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.count" select="$system_cache__dita__x3A__p5gnuplot:value.count"/>
+                    </xsl:call-template>
+                   <!-- <stentry audience="rozklad_2007|2" current-grouping-key="2007|2" col="1">6666</stentry>
+                    <stentry debug="992"
+                        current-grouping-key="2007|2"
+                        audience="rozklad_2007|2"
+                        col="2">2</stentry>-->
+                    </xsl:element>
+                </xsl:when>
+                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name='graph.title'">
+                    <!--<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                    </xsl:call-template>--> 
+                    <xsl:element name="stentry">
+                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                    </xsl:call-template>
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.audience">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc"/>
+                        </xsl:call-template>
+                        
+                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.platform">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute" select="$system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute"/>
+                    </xsl:call-template>
+                    <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.group">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.count" select="$system_cache__dita__x3A__p5gnuplot:value.count"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute" select="$system_cache__dita__x3A__p5gnuplot:value.sum.attribute"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc"/>
+                    </xsl:call-template>
+                    <!--<xsl:call-template name="system_cache__dita__x3A__p5gnuplot:value">
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute" select="$system_cache__dita__x3A__p5gnuplot:value.sum.attribute"/>
+                        <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:value.count" select="$system_cache__dita__x3A__p5gnuplot:value.count"/>
+                    </xsl:call-template>-->
+                    <!-- <stentry audience="rozklad_2007|2" current-grouping-key="2007|2" col="1">6666</stentry>
+                    <stentry debug="992"
+                        current-grouping-key="2007|2"
+                        audience="rozklad_2007|2"
+                        col="2">2</stentry>-->
+                    </xsl:element>
+                </xsl:when>
+                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name='graph.color.name'">
+                    <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr">
+                        <xsl:element name="stentry">
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                        </xsl:call-template>
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot.read.graph.color">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr" select="$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr"/>
+                        </xsl:call-template>
+                        </xsl:element>
+                    </xsl:if>
+                </xsl:when>
+                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name='graph.yaxis'">
+                    <xsl:element name="stentry">
+                       <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+                           <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                       </xsl:call-template>
+                       <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.graph.yaxis">
+                           <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int" select="$system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"/>
+                       </xsl:call-template>
+                    </xsl:element>
+                </xsl:when>
+                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name='graph.fill.style'">
+                    <xsl:element name="stentry">
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                        </xsl:call-template>
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.graph.fill.style">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc" select="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.title" select="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.title"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle" select="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle"/>
+                        </xsl:call-template>
+                    </xsl:element>
                 </xsl:when>
+                <xsl:when test="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name='graph.newhistogram'">
+                    <xsl:element name="stentry">
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                        </xsl:call-template>
+                        <xsl:call-template name="system_cache__dita__x3A__p5gnuplot:read.graph.newhistogram">
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc"/>
+                            <xsl:with-param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc"/>
+                        </xsl:call-template>
+                    </xsl:element>
+                </xsl:when>
+                
+                
+                <xsl:otherwise>
+                    <!--<xsl:if test="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc">
+                        <xsl:attribute name="current-grouping-key" select="$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+                    </xsl:if>-->
+                </xsl:otherwise>
             </xsl:choose>
             
-        </xsl:element>
+                            <!--<xsl:attribute name="props.var" select="$system_cache__dita__x3A__p5gnuplot:interface.strow.props.name"/>-->
+                             <!--<xsl:variable name="system_cache__dita__x3A__p5gnuplot:audience.string">
+                                 <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc">
+                                     <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/>
+                                 </xsl:if>
+                                 <xsl:if test="$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc">
+                                     <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc"/>
+                                 </xsl:if>
+                             </xsl:variable>-->
+                             <!--<xsl:if test="string-length($system_cache__dita__x3A__p5gnuplot:audience.string)&gt;0">
+                                 <xsl:attribute name="audience" select="$system_cache__dita__x3A__p5gnuplot:audience.string"/>
+                             </xsl:if>-->
+                             
+                             
+                            <!-- 
+                             <xsl:variable name="system_cache__dita__x3A__p5gnuplot:group.string">
+                                 <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc">
+                                     <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc"/>
+                                 </xsl:if>
+                                 <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc">
+                                     <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>
+                                 </xsl:if>
+                             </xsl:variable>
+                             
+                             <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.title.text.uniq.desc">
+                                 <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.title.text.uniq.desc"/>
+                             </xsl:if>
+                             <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.title.time.uniq.desc">
+                                 <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.title.time.uniq.desc"/>
+                             </xsl:if>
+                             <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.title.string.uniq.desc">
+                                 <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.title.string.uniq.desc"/>
+                             </xsl:if>
+                             <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.color.name.text">
+                                 <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.color.name.text"/>
+                             </xsl:if>
+                             
+                             <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.yaxis.int">
+                                 <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"/>
+                             </xsl:if>
+                             
+                             <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc">
+                                 <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc"/>
+                             </xsl:if>
+                             
+                             
+                             -->
+                             
+                             <!--<xsl:choose>
+                                 <xsl:when test="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc">
+                                     <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/>
+                                 </xsl:when>
+                             </xsl:choose>-->
+                        <!--<xsl:attribute name="debug.end"/>-->
+                        <!--<parms>
+                            <xsl:copy-of select="$system_cache__dita__x3A__p5gnuplot:interface.for-each-group.root.context/@*"/>
+                        </parms>-->
+                        <!--<context>
+                            <xsl:copy-of select="@*"/>
+                        </context>-->
+        
         <!-- wymaga 
             system_cache__dita__x3A__p5gnuplot:strow.new  empty  
             or last system_cache__dita__x3A__p5gnuplot:stentry.new
@@ -357,6 +686,324 @@
         -->
     </xsl:template>
     
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.stats">
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:FieldType" required="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:ValueType" required="yes"/>
+        <xsl:param name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" required="yes"/>
+        <xsl:param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" required="yes"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience" required="yes"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root" required="yes"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count" required="yes"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum" required="yes"/>
+        
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.stats" select="true()"/>
+        <xsl:attribute name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+        <xsl:attribute name="default_db__x3A__BI_audit_BENFORD:ValueType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+        <xsl:attribute name="p5gnuplot:simpletable__x3A__graph.stats.group_by.root" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by.root"/>
+        <xsl:attribute name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$p5gnuplot:simpletable__x3A__graph.stats.group_by"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.audience"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.root"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.count"/>
+        <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum" select="$system_cache__dita__x3A__p5gnuplot:set.simpletable__x3A__graph.group.sum"/>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:current-grouping-key">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc"/>
+        <xsl:attribute name="current-grouping-key">
+            <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:current-grouping-key.time.uniq.desc]"/>
+        </xsl:attribute>
+    </xsl:template>
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.audience">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/>
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc"/>
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc"/>
+        </xsl:if>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:read.audience">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc"/>
+        <xsl:attribute name="audience">
+            <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:audience.string.uniq.desc"/>
+            <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:audience.time.uniq.desc]"/>
+            <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:audience.value.uniq.desc]"/>
+        </xsl:attribute>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.value.sum">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute" required="no"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:value.count"/>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:value.sum.attribute">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute" select="$system_cache__dita__x3A__p5gnuplot:value.sum.attribute"/>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:value.count">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:value.count" select="$system_cache__dita__x3A__p5gnuplot:value.count"/>
+            </xsl:when>
+        </xsl:choose>
+        
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:value">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:value.count"/>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:value.sum.attribute">
+                <!--<xsl:attribute name="props">sum</xsl:attribute>-->
+                <xsl:value-of select="sum(current-group()/number(@*[name()=$system_cache__dita__x3A__p5gnuplot:value.sum.attribute]))"/>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:value.count">
+                <!--<xsl:attribute name="props">count</xsl:attribute>-->
+                <xsl:value-of select="count(current-group())"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:value-of select="'error.478'"/>
+            </xsl:otherwise>
+        </xsl:choose>
+        
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.header">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/>
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc"/>
+        </xsl:if>
+    </xsl:template>
+    
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:read.header">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc"/>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc or $system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc">
+                <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc]"/> 
+                <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:graph.headers.value.uniq.desc]"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:message>#325 ERROR not required expected @system_cache__dita__x3A__p5gnuplot:graph.headers.time.uniq.desc</xsl:message>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.group">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc"/>
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>                
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc"/>                
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc"/>
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc"/>
+        </xsl:if>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:read.group">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:value.sum.attribute"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:value.count"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc"/>
+        <xsl:attribute name="debug.group" select="@default_db__x3A__BI_audit_BENFORD:leadingNumber"/>
+        <xsl:attribute name="debug.group.nam" select="$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc"/>
+        <xsl:attribute name="group">
+            <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc">
+                <xsl:value-of  select="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>                
+            </xsl:if>
+            <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc">
+                <xsl:value-of  select="@*[name()=$system_cache__dita__x3A__p5gnuplot:group.time.uniq.desc]"/>
+            </xsl:if>
+            <xsl:if test="$system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc">
+                <xsl:value-of  select="@*[name()=$system_cache__dita__x3A__p5gnuplot:group.value.uniq.desc]"/>
+            </xsl:if>
+        </xsl:attribute>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:value.sum.attribute">
+                <xsl:attribute name="props">sum</xsl:attribute>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot:value.count">
+                <xsl:attribute name="props">count</xsl:attribute>
+            </xsl:when>
+        </xsl:choose>
+        <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:group.string.uniq.desc"/>
+        <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:group.text.time.uniq.desc]"/>
+        <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:group.text.value.uniq.desc]"/>
+    </xsl:template>
+    
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.graph.color">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.color.name.text"/><!-- todo options blue,red -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr"/>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot.graph.color.name.text">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.color.name.text" select="$system_cache__dita__x3A__p5gnuplot.graph.color.name.text"/>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr" select="$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:message terminate="yes">#589 not set required params for tmpl system_cache__dita__x3A__p5gnuplot.set.graph.color or @system_cache__dita__x3A__p5gnuplot.graph.color.name.text or @system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr</xsl:message>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot.read.graph.color">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.color.name.text"/><!-- todo options blue,red -->
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr"/>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr">
+                <xsl:choose>
+                    <xsl:when test="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]='1'">#0000FF</xsl:when>
+                    <xsl:when test="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]='2'">#0000AA</xsl:when>
+                    <xsl:when test="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]='3'">#000066</xsl:when>
+                    <xsl:when test="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]='4'">#000033</xsl:when>
+                    <xsl:when test="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]='5'">#003300</xsl:when>
+                    <xsl:when test="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]='6'">#006600</xsl:when>
+                    <xsl:when test="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]='7'">#009900</xsl:when>
+                    <xsl:when test="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]='8'">#00CC00</xsl:when>
+                    <xsl:when test="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]='9'">#00FF00</xsl:when>
+                    <xsl:otherwise>#<xsl:value-of select="9-number(@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr])"/>0<xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]"/>0<xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot.graph.color.auto.index.attr]"/>F</xsl:otherwise>
+                </xsl:choose>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot.graph.color.name.text">
+                <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot.graph.color.name.text"/>
+            </xsl:when>
+        </xsl:choose>
+    </xsl:template>
+    
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.graph.yaxis">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.yaxis.int">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int" select="$system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"/>
+        </xsl:if>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:read.graph.yaxis">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.yaxis.int">
+            <xsl:value-of  select="$system_cache__dita__x3A__p5gnuplot.graph.yaxis.int"/>
+        </xsl:if>
+    </xsl:template>
+    
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.graph.fill.style">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.title"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc" select="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc"/>
+        </xsl:if>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.title and $system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle">
+                <xsl:message terminate="yes">#668 incorrect both set $system_cache__dita__x3A__p5gnuplot.graph.fill.style.title and $system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle</xsl:message>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.title">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.title" select="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.title"/>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle">
+                <xsl:attribute name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle" select="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle"/>
+            </xsl:when>
+        </xsl:choose>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:read.graph.fill.style">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.title"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle"/>
+        <xsl:choose>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.title">
+                <xsl:attribute name="props">graph.title</xsl:attribute>
+            </xsl:when>
+            <xsl:when test="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.notitle">
+                <xsl:attribute name="props">graph.notitle</xsl:attribute>
+            </xsl:when>    
+        </xsl:choose>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc">
+            <xsl:value-of  select="$system_cache__dita__x3A__p5gnuplot.graph.fill.style.desc"/>
+        </xsl:if>
+    </xsl:template>
+    
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.graph.newhistogram">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc"/>
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc"/>
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc"/>
+        </xsl:if>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc" select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc"/>
+        </xsl:if>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:read.graph.newhistogram">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc"/>
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc or $system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc">
+            <xsl:attribute name="audience">
+                <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.string.uniq.desc"/>
+                <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.audience.time.uniq.desc]"/>
+            </xsl:attribute>
+        </xsl:if>
+        <!--<xsl:if test="position()=last()"><xsl:value-of select="'last'"/></xsl:if>-->
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc or $system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc">
+            <xsl:value-of select="$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.uniq.desc"/>
+            <xsl:value-of select="@*[name()=$system_cache__dita__x3A__p5gnuplot:graph.newhistogram.text.time.uniq.desc]"/>
+        </xsl:if>
+    </xsl:template>
+    
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:set.platform">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute">
+            <xsl:attribute name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute" select="$system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute"/>
+        </xsl:if>
+    </xsl:template>
+    
+    <xsl:template name="system_cache__dita__x3A__p5gnuplot:read.platform">
+        <xsl:param name="system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute"/>
+        <xsl:if test="$system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute">
+            <xsl:attribute name="platform" select="$system_cache__dita__x3A__p5gnuplot:platform.time.uniq.attribute"/>
+        </xsl:if>
+    </xsl:template>
+    
     <xsl:template name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.validate">
         <xsl:param name="system_cache__dita__x3A__p5gnuplot:interface.SIMPLETABLE_WTITLE.xml.temporary"/>
         <!--<xsl:param name="system_cache__dita__x3A__p5gnuplot:graph.headers.text.string.uniq.desc"/>--><!--  audience="rozklad_2013|3" col="1">2013|3</s -->

+ 8 - 1
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.localname.translate.xsl

@@ -123,6 +123,11 @@
         <xsl:text>rok|kwartał</xsl:text>
     </xsl:template>
     
+    
+    <xsl:template mode="system_cache__dita:localname.translate" match="@default_db__x3A__BI_audit_BENFORD:CostSubjectFields.Rejestrujacy_w_RUM___nazwisko_i_imie" >
+        <xsl:text>Rej. w RUM</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')]|
@@ -148,7 +153,9 @@
     
     
     
-    <xsl:template mode="system_cache__dita:localname.translate" match="@*"/>
+    <xsl:template mode="system_cache__dita:localname.translate" match="@*">
+        <xsl:message>#162 WARNING system_cache__dita:localname.translate - NOT FOUND TRANSLATION for @<xsl:value-of select="name()"/>=<xsl:value-of select="."/></xsl:message>
+    </xsl:template>
     
     
     

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

@@ -151,6 +151,8 @@
     <xsl:import href="../default_db/system_cache__dita__x3A__p5gnuplot/system_cache__dita__x3A__p5gnuplot.interface.xsl"/>
     
     
+    <xsl:include href="../../WPS_Functions/SvgCharts4Xsl/charts.xsl"/>
+    
     <xsl:include href="get_wfs_recurse_xsl.RelatedFeature.preprocess.xsl"/>
     
     <xsl:include href="../dita_enter_to_ph.xsl"/>

+ 1 - 1
SE/schema/default_db_xml_cache/build_complexType.xsl

@@ -21,7 +21,7 @@
     
     
     <xsl:output indent="yes"/>
-    <xsl:param name="system_cache__appinfo:path.2863.len.limit" select="180"/>
+    <xsl:param name="system_cache__appinfo:path.2863.len.limit" select="150"/>
     <xsl:param name="debug_level_param" /><!-- select="4" -->
     
     <xsl:param name="default_db.instance.xml" required="yes"/>

+ 112 - 16
se.oxygen.xpr

@@ -2000,6 +2000,111 @@
                     <entry>
                         <String>scenario.associations</String>
                         <scenarioAssociation-array>
+                            <scenarioAssociation>
+                                <field name="url">
+                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-1415_000001/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row.3838636____APT_trasy_row.dita</String>
+                                </field>
+                                <field name="scenarioIds">
+                                    <list>
+                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
+                                    </list>
+                                </field>
+                                <field name="scenarioTypes">
+                                    <list>
+                                        <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/relations-1415_000001/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row.3838637____APT_trasy_row.dita</String>
+                                </field>
+                                <field name="scenarioIds">
+                                    <list>
+                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
+                                    </list>
+                                </field>
+                                <field name="scenarioTypes">
+                                    <list>
+                                        <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/relations-1415_000001/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI.81508____APU4_umowy.dita</String>
+                                </field>
+                                <field name="scenarioIds">
+                                    <list>
+                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
+                                    </list>
+                                </field>
+                                <field name="scenarioTypes">
+                                    <list>
+                                        <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/relations-1415_000001/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI.81132____APU4_umowy.dita</String>
+                                </field>
+                                <field name="scenarioIds">
+                                    <list>
+                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
+                                    </list>
+                                </field>
+                                <field name="scenarioTypes">
+                                    <list>
+                                        <String>DITAMAP</String>
+                                    </list>
+                                </field>
+                            </scenarioAssociation>
+                            <scenarioAssociation>
+                                <field name="url">
+                                    <String>../../Downloads/relations-1415_000001/temp/pdf-css/relations-1415_000001.ditamap</String>
+                                </field>
+                                <field name="scenarioIds">
+                                    <list>
+                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
+                                    </list>
+                                </field>
+                                <field name="scenarioTypes">
+                                    <list>
+                                        <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/relations-1415_000001/BI_audit_ENERGA_PRACOWNICY/BI_audit_ENERGA_PRACOWNICY.65424____APU4_umowy.dita</String>
+                                </field>
+                                <field name="scenarioIds">
+                                    <list>
+                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
+                                    </list>
+                                </field>
+                                <field name="scenarioTypes">
+                                    <list>
+                                        <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/relations-1415_000001/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI.82231____APU4_umowy.dita</String>
+                                </field>
+                                <field name="scenarioIds">
+                                    <list>
+                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
+                                    </list>
+                                </field>
+                                <field name="scenarioTypes">
+                                    <list>
+                                        <String>DITAMAP</String>
+                                    </list>
+                                </field>
+                            </scenarioAssociation>
                             <scenarioAssociation>
                                 <field name="url">
                                     <String>SE/schema/WPS_Functions/SvgCharts4Xsl/install/examples/pieChartExample2.xsl</String>
@@ -2120,21 +2225,6 @@
                                     </list>
                                 </field>
                             </scenarioAssociation>
-                            <scenarioAssociation>
-                                <field name="url">
-                                    <String>../../../../opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/default_db/CRM_PROCES_tree/relations-1415_000001/BI_audit_ENERGA_PRACOWNICY/BI_audit_ENERGA_PRACOWNICY.65424____APU4_umowy.dita</String>
-                                </field>
-                                <field name="scenarioIds">
-                                    <list>
-                                        <String>DITA Map PDF - based on XSL-FO - Copy</String>
-                                    </list>
-                                </field>
-                                <field name="scenarioTypes">
-                                    <list>
-                                        <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/relations-1415_000001/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row.3838641____APT_trasy.dita</String>
@@ -3154,7 +3244,12 @@
             <file name="SE/schema/WPS_Functions/get_wfs_recurse_xsl/get_wfs_recurse_xsl.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__from_rows.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__from_rows__x3A__analyze.xsl"/>
+            <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats.xsl"/>
+            <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl"/>
+            <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsd.param.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xsl"/>
+            <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xtics.xsd"/>
+            <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.xtics.xsd.param.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics.header.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics__x3A__dat.xsl"/>
@@ -3165,6 +3260,7 @@
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.color.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.xaxis.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.xsl"/>
+            <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.yaxis.standalone.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__ytics.yaxis.xsl"/>
             <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat__x3A__init.xsl"/>
             <file name="SE/schema/WPS_Functions/graph_tree_TODO_PROJ6806/graph_tree_yed.xsl"/>
@@ -3240,6 +3336,7 @@
             <file name="SE/schema/ant-object/default_db.STRUCTURE.dependency.subject.backRef/STRUCTURE.dependency.subject.backRef/STRUCTURE.dependency.subject.backRef.xpath.constructor.xsl"/>
             <file name="SE/schema/ant-object/default_db.STRUCTURE.dependency.subject.backRef/STRUCTURE.dependency.subject.backRef/STRUCTURE.dependency.subject.backRef.xsd"/>
             <file name="SE/schema/ant-object/default_db.STRUCTURE.dependency.subject.backRef/STRUCTURE.dependency.subject.backRef/STRUCTURE.dependency.subject.backRef.xsl"/>
+            <file name="SE/schema/default_db_xml_cache.public/default_db/system_cache__dita__x3A__p5gnuplot/system_cache__dita__x3A__p5gnuplot.interface.xsl"/>
             <file name="SE/schema/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsl"/>
             <file name="SE/schema/WPS_Functions/dita-ot/dita-ot-2.3.3/plugins/com.sophos.tocjs/xsl/tocjs.xsl"/>
             <file name="SE/schema/WPS_Functions/dita-ot/dita-ot-2.3.3/plugins/org.dita.pdf2/xsl/fo/topic2fo_shell.xsl"/>
@@ -3303,6 +3400,5 @@
         <folder path="../../procesy5-dita-templates-druki/6927.Projekt_Badawczo_Roz_Procesy5_Stratego/sebastianbinder/raszczyk2.0/custom_template_webhelp/SebaRaszczyk/"/>
         <folder path="../../procesy5-dita-templates-druki/procesy5-wfs-api-doc/procesy5AndroidApp.git/Procesy5/"/>
         <folder path="../../procesy5-dita-templates-druki/xmlschema_procesy5/src-xmlschema/public_html/"/>
-        <file name="SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplotdat.row__x3A__from__xtics.xsl"/>
     </projectTree>
 </project>