| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?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:raport="procesy5_raport"
- exclude-result-prefixes="xs"
- version="2.0">
-
- <xsl:output indent="yes"/>
- <xsl:strip-space elements="*"/>
-
- <xsl:param name="temp" required="yes"/>
-
-
- <xsl:variable name="raport:df_correct">
- <disk raport:max_capacity="90" raport:min_free="1000"/>
- </xsl:variable>
-
-
-
- <xsl:template name="build_procesy5_status">
- <xsl:message>#13 odpalam templ $temp:<xsl:value-of select="$temp"/>; </xsl:message>
- <xsl:variable name="collection" select="collection(concat($temp,'/?select=*.xml'))"/>
- <build_procesy5_status>
- <xsl:apply-templates select="$collection"/>
- </build_procesy5_status>
- </xsl:template>
-
-
- <xsl:template match="storage_free.xml">
- <storage_free.xml>
- <xsl:apply-templates mode="df_output"/>
-
- </storage_free.xml>
-
- </xsl:template>
-
-
- <!-- [element]
- [text]
- [attribute]
- [text]
- [element]
- [comment]
- [processing instruction]-->
-
-
-
- <!-- <xsl:template match="empty"/> -->
-
-
-
- <xsl:template match="*|text()" mode="df_output">
- <xsl:variable name="df_output">
- <df_output>
- <xsl:for-each select="tokenize(.,'\n')">
- <xsl:if test="position() > 1">
- <row><xsl:attribute name="pos" select="position()-1"/>
- <xsl:for-each select="tokenize(normalize-space(.),' ')">
- <el><xsl:attribute name="pos" select="position()"/>
- <xsl:value-of select="."/></el>
- </xsl:for-each>
- </row>
- </xsl:if>
- <xsl:if test="position() = 1">
- <fields>
- <xsl:for-each select="tokenize(normalize-space(.),' ')">
- <el><xsl:attribute name="pos" select="position()"/>
- <xsl:value-of select="."/></el>
- </xsl:for-each>
- </fields>
- </xsl:if>
- </xsl:for-each>
- </df_output>
- </xsl:variable>
-
- <raport:df>
- <xsl:for-each select="$df_output//row">
- <disk>
- <xsl:attribute name="{$df_output//fields/el[@pos='1']}" select="el[@pos='1']"/>
- <xsl:element name="{$df_output//fields/el[@pos='5']}">
- <xsl:if test="number(replace(el[@pos='5'],'%','')) > number($raport:df_correct/disk/@raport:max_capacity)">
- <xsl:attribute name="error" select="'Zbyt duże wykorzystanie'"/>
- </xsl:if>
- <xsl:value-of select="el[@pos='5']"/>
- </xsl:element>
- <xsl:element name="{$df_output//fields/el[@pos='4']}">
- <xsl:if test="number(el[@pos='4']) < number($raport:df_correct/disk/@raport:min_free)">
- <xsl:attribute name="error" select="'Zbyt mało wolnego miejsca'"/>
- </xsl:if>
- <xsl:value-of select="el[@pos='4']"/>
- </xsl:element>
- </disk>
- </xsl:for-each>
- </raport:df>
- <!--<xsl:copy-of select="$df_output"/>-->
- </xsl:template>
-
-
-
-
-
-
- </xsl:stylesheet>
|