diff options
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/csv2xml.xslt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt index fd08c8b57..770455a6f 100644 --- a/xslt/csv2xml.xslt +++ b/xslt/csv2xml.xslt @@ -31,6 +31,8 @@ <xsl:param name="Firmware" select="Firmware"/> <xsl:param name="Serial" select="Serial"/> <xsl:param name="GF" select="GF"/> + <xsl:param name="maxDepth" select="maxDepth"/> + <xsl:param name="meanDepth" select="meanDepth"/> <xsl:output method="xml" indent="yes"/> <xsl:variable name="lf"><xsl:text> @@ -189,6 +191,35 @@ </extradata> </xsl:if> + <xsl:if test="string-length($maxDepth) > 0 or string-length($meanDepth) > 0"> + <depth> + <xsl:if test="string-length($maxDepth) > 0"> + <xsl:attribute name="max"> + <xsl:choose> + <xsl:when test="$units = 0"> + <xsl:value-of select="translate($maxDepth, ',', '.')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="round(translate(translate($maxDepth, translate($maxDepth, '0123456789,.', ''), ''), ',', '.') * 0.3048 * 1000) div 1000"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:if> + <xsl:if test="string-length($meanDepth) > 0"> + <xsl:attribute name="mean"> + <xsl:choose> + <xsl:when test="$units = 0"> + <xsl:value-of select="translate($meanDepth, ',', '.')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="round(translate(translate($meanDepth, translate($meanDepth, '0123456789,.', ''), ''), ',', '.') * 0.3048 * 1000) div 1000"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:if> + </depth> + </xsl:if> + <xsl:call-template name="printLine"> <xsl:with-param name="line" select="substring-before(//csv, $lf)"/> <xsl:with-param name="lineno" select="'1'"/> |