2014-03-01 23:17:32 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
|
|
|
<xsl:strip-space elements="*"/>
|
|
|
|
<xsl:output method="text" encoding="UTF-8"/>
|
|
|
|
|
|
|
|
<xsl:variable name="fs">,</xsl:variable>
|
|
|
|
|
|
|
|
<xsl:template match="/divelog/dives">
|
2014-04-26 07:55:40 +00:00
|
|
|
<xsl:value-of select="concat('"dive number"', $fs, '"dive date"', $fs, '"dive time"', $fs, '"time"', $fs, '"depth"', $fs, '"temperature"', $fs, '"pressure"')"/>
|
2014-03-01 23:17:32 +00:00
|
|
|
<xsl:text>
|
|
|
|
</xsl:text>
|
|
|
|
<xsl:apply-templates select="dive|trip/dive"/>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="dive">
|
|
|
|
<xsl:variable name="number">
|
|
|
|
<xsl:value-of select="@number"/>
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:variable name="date">
|
|
|
|
<xsl:value-of select="@date"/>
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:variable name="time">
|
|
|
|
<xsl:value-of select="@time"/>
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:for-each select="divecomputer/sample|sample">
|
|
|
|
<xsl:value-of select="concat('"', $number, '"')"/>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:value-of select="concat('"', $date, '"')"/>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:value-of select="concat('"', $time, '"')"/>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:value-of select="concat('"', substring-before(@time, ' '), '"')"/>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:value-of select="concat('"', substring-before(@depth, ' '), '"')"/>
|
|
|
|
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:if test="@temp != ''">
|
|
|
|
<xsl:value-of select="concat('"', substring-before(@temp, ' '), '"')"/>
|
|
|
|
</xsl:if>
|
|
|
|
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:if test="@pressure != ''">
|
|
|
|
<xsl:value-of select="concat('"', substring-before(@pressure, ' '), '"')"/>
|
|
|
|
</xsl:if>
|
|
|
|
|
|
|
|
<xsl:text>
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:for-each>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|