Skip to content

Commit

Permalink
Merge pull request #17 from equinor/Fix,-if-check-of-symbol-not-prese…
Browse files Browse the repository at this point in the history
…nt-in-origo

Added if-check
  • Loading branch information
eoye authored Oct 3, 2024
2 parents 1fa24bb + f817266 commit 93a9441
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions www/dexpisvgNoaka.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -217,39 +217,41 @@
</xsl:variable>
<xsl:variable name="shapeValue" select="//ShapeCatalogue/*[@ComponentName=$componentName]/GenericAttributes/GenericAttribute/@Value"/>
<xsl:variable name="path" select="concat('../../../../NOAKADEXPI/Symbols/Origo/', $shapeValue, '_Origo.svg')" />
<xsl:if test="$shapeValue">
<defs>
<symbol overflow="visible">
<xsl:attribute name="id">
<xsl:value-of select="$shapeId" />
</xsl:attribute>
<xsl:attribute name="shapeName">
<xsl:value-of select="$shapeValue"/>
</xsl:attribute>
<xsl:attribute name="path">
<xsl:value-of select="$path" />
<xsl:if test="not($path = '../../../../NOAKADEXPI/Symbols/Origo/BORDER_A1_Origo.svg')">
<xsl:if test="$shapeValue">
<defs>
<symbol overflow="visible">
<xsl:attribute name="id">
<xsl:value-of select="$shapeId" />
</xsl:attribute>
<xsl:attribute name="shapeName">
<xsl:value-of select="$shapeValue"/>
</xsl:attribute>
<xsl:attribute name="path">
<xsl:value-of select="$path" />
</xsl:attribute>
<xsl:variable name="doc" select="document($path)" />
<xsl:apply-templates
select="$doc//svg:g/*">
<xsl:with-param name="labelParam" select="$label" />
<xsl:with-param name="idValue" select="$id" />
</xsl:apply-templates>
</symbol>
</defs>
<use>
<xsl:attribute name="href">
<xsl:value-of select="concat('#', $shapeId)" />
</xsl:attribute>
<xsl:variable name="doc" select="document($path)" />
<xsl:apply-templates
select="$doc//svg:g/*">
<xsl:with-param name="labelParam" select="$label" />
<xsl:with-param name="idValue" select="$id" />
</xsl:apply-templates>
</symbol>
</defs>
<use>
<xsl:attribute name="href">
<xsl:value-of select="concat('#', $shapeId)" />
</xsl:attribute>
<xsl:call-template name="Position">
<xsl:with-param name="height" select="$height" />
<xsl:with-param name="PositionNode" select="Position" />
</xsl:call-template>
</use>
<xsl:call-template name="Position">
<xsl:with-param name="height" select="$height" />
<xsl:with-param name="PositionNode" select="Position" />
</xsl:call-template>
</use>
</xsl:if>
<xsl:apply-templates>
<xsl:with-param name="height" select="$height" />
</xsl:apply-templates>
</xsl:if>
<xsl:apply-templates>
<xsl:with-param name="height" select="$height" />
</xsl:apply-templates>
</xsl:template>

<!-- Shape catalogue-->
Expand Down

0 comments on commit 93a9441

Please sign in to comment.