a.binder 7 лет назад
Родитель
Сommit
cee9dfe412

+ 165 - 0
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__from_rows.xsl

@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns: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">
+    
+    
+    
+    <xsl:template name="p5gnuplot:simpletable__x3A__from_rows">
+        <xsl:param name="simpletable" required="yes"/>
+        <xsl:param name="title"/>
+        
+        <xsl:variable name="graph.title" select="$simpletable//(strow|sthead)[ contains(@props,'graph.title') ]" />
+        <!--<DEBUG.simpletable>
+            <xsl:copy-of select="$simpletable//strow"/>
+        </DEBUG.simpletable>-->
+        
+        
+        
+        <xsl:variable name="graph.headers" select="$simpletable//(strow|sthead)[ contains(@props,'graph.headers') ]"/>
+        <xsl:variable name="graph.data" select="$simpletable//(strow|sthead)[ contains(@props,'graph.data')]"/>
+        
+        
+        
+        
+        <xsl:choose>
+            <xsl:when test="$graph.title/* and $graph.data/* and $graph.headers/*">
+                <p><xsl:value-of select="$title"/></p>
+                <p>
+                
+                        <xsl:variable name="xtics">
+                                    <xtics>
+                                        <xsl:for-each-group select="$graph.headers//stentry" group-by="text()">
+                                            <xsl:copy>
+                                                <xsl:copy-of select="@*"/>
+                                                <xsl:attribute name="pos" select="position()"/>
+                                                <xsl:copy-of select="text()"/>
+                                            </xsl:copy>
+                                        </xsl:for-each-group>
+                                    </xtics>
+                        </xsl:variable>
+                        
+                        <xsl:variable name="ytics">
+                            <ytics>
+                                <xsl:for-each-group select="$graph.title//stentry" group-by="text()">
+                                        <xsl:copy>
+                                            <xsl:attribute name="pos" select="position()"/>
+                                            <xsl:copy-of select="@*"/>
+                                            <xsl:copy-of select="text()"/>
+                                        </xsl:copy>
+                                </xsl:for-each-group>
+                            </ytics>
+                        </xsl:variable>
+                        
+                        <!--<xsl:copy-of select="$xtics"/>-->
+                        <!--<xsl:copy-of select="$ytics"/>-->
+                        <simpletable props="nograph">
+                            <!--<strow props="xtics.1">
+                                <xsl:for-each select="$xtics//current-grouping-key">
+                                    <stentry position="{position()}">
+                                        <xsl:value-of select="text()"/>
+                                    </stentry>
+                                </xsl:for-each>
+                            </strow>-->
+                            <!--<strow props="ytics.1">
+                                <xsl:for-each select="$ytics//stentry">
+                                    <stentry>
+                                        <xsl:value-of select="text()"/>
+                                    </stentry>
+                                </xsl:for-each>
+                            </strow>-->
+                            <strow props="pos___{position()} deb_81">
+                                <stentry >
+                                    <xsl:text>parametr</xsl:text>
+                                </stentry>
+                                <xsl:for-each select="1 to count($xtics//stentry)">
+                                    <xsl:variable name="current-grouping-key" select="$xtics//stentry[@pos=current()]/@current-grouping-key"/>
+                                    <xsl:variable name="audience" select="$xtics//stentry[@pos=current()]/@audience"/>
+                                    <xsl:variable name="group" select="$xtics//stentry[@current-grouping-key=$current-grouping-key][1]/@group"/>
+                                    
+                                    
+                                    <stentry  audience="{$audience}">
+                                        <xsl:value-of select="$graph.headers//stentry[@current-grouping-key=$current-grouping-key][1]/system_cache__dita:graph.lingstring__x3A__break(text(),8,'-')"/>
+                                    </stentry>
+                                        <!--<xsl:for-each select="$xtics//stentry">
+                                            <stentry>
+                                                <xsl:copy-of select="@*"/>
+                                                
+                                            </stentry>
+                                        </xsl:for-each>-->
+                                    
+                                </xsl:for-each>
+                            </strow>
+                            
+                            <strow props="pos___{position()} deb_82">
+                                <stentry >
+                                    <xsl:value-of select="$ytics//stentry[1]/text()"/>
+                                </stentry>
+                                <xsl:for-each select="1 to count($xtics//stentry)">
+                                    <xsl:variable name="current-grouping-key" select="$xtics//stentry[@pos=current()]/@current-grouping-key"/>
+                                    <xsl:variable name="audience" select="$xtics//stentry[@pos=current()]/@audience"/>
+                                    <xsl:variable name="group" select="$xtics//stentry[@current-grouping-key=$current-grouping-key][1]/@group"/>
+                                    
+                                    
+                                    <stentry  audience="{$audience}">
+                                        <xsl:value-of select="$graph.data//stentry[@current-grouping-key=$current-grouping-key][1]/substring(text(),1,8)"/>
+                                    </stentry>
+                                    <!--<xsl:for-each select="$xtics//stentry">
+                                            <stentry>
+                                                <xsl:copy-of select="@*"/>
+                                                
+                                            </stentry>
+                                        </xsl:for-each>-->
+                                    
+                                </xsl:for-each>
+                            </strow>
+                            
+                            <xsl:variable name="strow">
+                                <strow props="pos___{position()} deb_82">
+                                    <stentry >
+                                        <xsl:value-of select="$ytics//stentry[2]/text()"/>
+                                    </stentry>
+                                    <xsl:for-each select="1 to count($xtics//stentry)">
+                                        <xsl:variable name="current-grouping-key" select="$xtics//stentry[@pos=current()]/@current-grouping-key"/>
+                                        <xsl:variable name="audience" select="$xtics//stentry[@pos=current()]/@audience"/>
+                                        <xsl:variable name="group" select="$xtics//stentry[@current-grouping-key=$current-grouping-key][2]/@group"/>
+                                        
+                                        
+                                        <stentry  audience="{$audience}">
+                                            <xsl:value-of select="$graph.data//stentry[@current-grouping-key=$current-grouping-key][2]/substring(text(),1,8)"/>
+                                        </stentry>
+                                        <!--<xsl:for-each select="$xtics//stentry">
+                                                <stentry>
+                                                    <xsl:copy-of select="@*"/>
+                                                    
+                                                </stentry>
+                                            </xsl:for-each>-->
+                                        
+                                    </xsl:for-each>
+                                </strow>
+                            </xsl:variable>
+                            <xsl:if test="$strow//stentry[2]">
+                                <xsl:copy-of select="$strow"/>
+                            </xsl:if>
+                        </simpletable>
+                    
+                     
+                    
+                </p>
+                
+                
+            </xsl:when>
+        </xsl:choose>
+        
+    </xsl:template>
+    
+    
+    
+    
+    
+</xsl:stylesheet>