|
|
@@ -12,7 +12,7 @@
|
|
|
|
|
|
|
|
|
<xsl:variable name="raport:df_correct">
|
|
|
- <hd0 raport:free="100"/>
|
|
|
+ <disk raport:max_capacity="90" raport:min_free="1000"/>
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
|
@@ -45,30 +45,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
- <xsl:template match="empty"/>
|
|
|
+ <!-- <xsl:template match="empty"/> -->
|
|
|
|
|
|
|
|
|
|
|
|
<xsl:template match="*|text()" mode="df_output">
|
|
|
<xsl:variable name="df_output">
|
|
|
<df_output>
|
|
|
- <xsl:for-each select="tokenize(normalize-space(.),' ')">
|
|
|
- <el><xsl:attribute name="pos" select="position()"/>
|
|
|
- <xsl:value-of select="."/></el>
|
|
|
- </xsl:for-each>
|
|
|
+ <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:for-each>
|
|
|
</df_output>
|
|
|
</xsl:variable>
|
|
|
|
|
|
<raport:df>
|
|
|
- <hd0>
|
|
|
- <xsl:attribute name="raport:free" select="$df_output//el[@pos='17']"/>
|
|
|
- <xsl:if test="number($raport:df_correct/hd0/@raport:free) > number($df_output//el[@pos='17']) ">
|
|
|
- <xsl:attribute name="error" select="'blad za malo'"/>
|
|
|
- </xsl:if>
|
|
|
- <!--<xsl:processing-instruction name="php">
|
|
|
- echo "dupa";
|
|
|
- </xsl:processing-instruction>-->
|
|
|
- </hd0>
|
|
|
+ <xsl:for-each select="$df_output//row">
|
|
|
+ <disk>
|
|
|
+ <xsl:attribute name="Mountpoint" select="el[@pos='1']"/>
|
|
|
+ <xsl:element name="Capacity">
|
|
|
+ <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="Available">
|
|
|
+ <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>
|