Changeset 5f3f641 in subsurface


Ignore:
Timestamp:
May 6, 2017, 8:06:42 AM (3 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
b7c6998
Parents:
9536529
git-author:
Miika Turkia <miika.turkia@…> (05/05/17 09:17:57)
git-committer:
Dirk Hohndel <dirk@…> (05/06/17 08:06:42)
Message:

Add test mode support for UDDF export XSLT

The current code that calls the export transformation supports parameter
units, so using it here to enable test mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • xslt/uddf-export.xslt

    rba5f10a r5f3f641  
    44  <xsl:strip-space elements="*"/>
    55  <xsl:output method="xml" encoding="utf-8" indent="yes"/>
     6  <xsl:param name="units" select="units"/>
    67
    78  <xsl:key name="gases" match="cylinder" use="concat(substring-before(@o2, '.'), '/', substring-before(@he, '.'))" />
     
    180181
    181182        <xsl:for-each select="trip">
    182           <repetitiongroup id="{generate-id(.)}">
     183          <repetitiongroup>
     184            <xsl:attribute name="id">
     185              <xsl:choose>
     186                <xsl:when test="$test != ''">
     187                  <xsl:value-of select="generate-id(.)" />
     188                </xsl:when>
     189                <xsl:otherwise>
     190                  <xsl:value-of select="'testid1'" />
     191                </xsl:otherwise>
     192              </xsl:choose>
     193            </xsl:attribute>
     194
    183195            <xsl:apply-templates select="dive"/>
    184196          </repetitiongroup>
    185197        </xsl:for-each>
    186198        <xsl:for-each select="dive">
    187           <repetitiongroup id="{generate-id(.)}">
     199          <repetitiongroup>
     200            <xsl:attribute name="id">
     201              <xsl:choose>
     202                <xsl:when test="string-length($units) = 0">
     203                  <xsl:value-of select="generate-id(.)" />
     204                </xsl:when>
     205                <xsl:otherwise>
     206                  <xsl:value-of select="'testid2'" />
     207                </xsl:otherwise>
     208              </xsl:choose>
     209            </xsl:attribute>
    188210            <xsl:apply-templates select="."/>
    189211          </repetitiongroup>
     
    247269
    248270  <xsl:template match="dive">
    249     <dive id="{generate-id(.)}" xmlns="http://www.streit.cc/uddf/3.2/">
     271    <dive xmlns="http://www.streit.cc/uddf/3.2/">
     272      <xsl:attribute name="id">
     273        <xsl:choose>
     274          <xsl:when test="string-length($units) = 0">
     275            <xsl:value-of select="generate-id(.)" />
     276          </xsl:when>
     277          <xsl:otherwise>
     278            <xsl:value-of select="'testid3'" />
     279          </xsl:otherwise>
     280        </xsl:choose>
     281      </xsl:attribute>
     282
    250283
    251284      <informationbeforedive>
Note: See TracChangeset for help on using the changeset viewer.