Skip to content

Commit 93a9441

Browse files
authoredOct 3, 2024
Merge pull request #17 from equinor/Fix,-if-check-of-symbol-not-present-in-origo
Added if-check
2 parents 1fa24bb + f817266 commit 93a9441

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed
 

‎www/dexpisvgNoaka.xslt

+33-31
Original file line numberDiff line numberDiff line change
@@ -217,39 +217,41 @@
217217
</xsl:variable>
218218
<xsl:variable name="shapeValue" select="//ShapeCatalogue/*[@ComponentName=$componentName]/GenericAttributes/GenericAttribute/@Value"/>
219219
<xsl:variable name="path" select="concat('../../../../NOAKADEXPI/Symbols/Origo/', $shapeValue, '_Origo.svg')" />
220-
<xsl:if test="$shapeValue">
221-
<defs>
222-
<symbol overflow="visible">
223-
<xsl:attribute name="id">
224-
<xsl:value-of select="$shapeId" />
225-
</xsl:attribute>
226-
<xsl:attribute name="shapeName">
227-
<xsl:value-of select="$shapeValue"/>
228-
</xsl:attribute>
229-
<xsl:attribute name="path">
230-
<xsl:value-of select="$path" />
220+
<xsl:if test="not($path = '../../../../NOAKADEXPI/Symbols/Origo/BORDER_A1_Origo.svg')">
221+
<xsl:if test="$shapeValue">
222+
<defs>
223+
<symbol overflow="visible">
224+
<xsl:attribute name="id">
225+
<xsl:value-of select="$shapeId" />
226+
</xsl:attribute>
227+
<xsl:attribute name="shapeName">
228+
<xsl:value-of select="$shapeValue"/>
229+
</xsl:attribute>
230+
<xsl:attribute name="path">
231+
<xsl:value-of select="$path" />
232+
</xsl:attribute>
233+
<xsl:variable name="doc" select="document($path)" />
234+
<xsl:apply-templates
235+
select="$doc//svg:g/*">
236+
<xsl:with-param name="labelParam" select="$label" />
237+
<xsl:with-param name="idValue" select="$id" />
238+
</xsl:apply-templates>
239+
</symbol>
240+
</defs>
241+
<use>
242+
<xsl:attribute name="href">
243+
<xsl:value-of select="concat('#', $shapeId)" />
231244
</xsl:attribute>
232-
<xsl:variable name="doc" select="document($path)" />
233-
<xsl:apply-templates
234-
select="$doc//svg:g/*">
235-
<xsl:with-param name="labelParam" select="$label" />
236-
<xsl:with-param name="idValue" select="$id" />
237-
</xsl:apply-templates>
238-
</symbol>
239-
</defs>
240-
<use>
241-
<xsl:attribute name="href">
242-
<xsl:value-of select="concat('#', $shapeId)" />
243-
</xsl:attribute>
244-
<xsl:call-template name="Position">
245-
<xsl:with-param name="height" select="$height" />
246-
<xsl:with-param name="PositionNode" select="Position" />
247-
</xsl:call-template>
248-
</use>
245+
<xsl:call-template name="Position">
246+
<xsl:with-param name="height" select="$height" />
247+
<xsl:with-param name="PositionNode" select="Position" />
248+
</xsl:call-template>
249+
</use>
250+
</xsl:if>
251+
<xsl:apply-templates>
252+
<xsl:with-param name="height" select="$height" />
253+
</xsl:apply-templates>
249254
</xsl:if>
250-
<xsl:apply-templates>
251-
<xsl:with-param name="height" select="$height" />
252-
</xsl:apply-templates>
253255
</xsl:template>
254256

255257
<!-- Shape catalogue-->

0 commit comments

Comments
 (0)