XSLT

Miika Turkia miika.turkia at gmail.com
Tue Feb 26 11:31:32 PST 2013


On Tue, Feb 26, 2013 at 9:19 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> Miika,
>
> as I warned you... I'm trying to understand the XSLT code. The best way
> to do that (I thought) was to try and fix bugs as I encounter them.

I bet that is less painful way than how I started (by writing the
jdivelog2subsurface.xslt - I had absolutely know knowledge of xslt at
the beginning)

> PLEASE review this to make sure I didn't do something stupid (I already
> pushed it to make reviewing easier)

Looks good. There might be a couple of similar elements missing - it
all pretty much depends on the particular file I used as source, or if
I just missed something that was actually there. (Whenever
concatenating the unit after the value, you want to verify the value
exists, otherwise we get the parse errors you saw earlier.)

miika

> [...]
>
> diff --git a/xslt/DivingLog.xslt b/xslt/DivingLog.xslt
> index 4a6b4d3..ced6a4e 100644
> --- a/xslt/DivingLog.xslt
> +++ b/xslt/DivingLog.xslt
> @@ -47,6 +47,11 @@
>              <xsl:value-of select="concat(Depth, ' m')"/>
>            </xsl:attribute>
>          </xsl:if>
> +        <xsl:if test="DepthAvg != ''">
> +          <xsl:attribute name="mean">
> +            <xsl:value-of select="concat(DepthAvg, ' m')"/>
> +          </xsl:attribute>
> +        </xsl:if>
>        </depth>
>
>        <location>


More information about the subsurface mailing list