Skip to content

Commit

Permalink
mn2sts xslt updated for IEC, termsource with std processing, #95
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 committed Nov 17, 2021
1 parent 43d914a commit 8695a81
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions src/main/resources/mn2sts.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2077,12 +2077,17 @@
<xsl:message>DEBUG: termsource processing <xsl:value-of select="parent::*/*[local-name() = 'name']"/></xsl:message>
</xsl:if> -->
<tbx:source>
<xsl:value-of select="origin/@citeas"/>
<xsl:apply-templates />
<!-- <xsl:value-of select="origin/@citeas"/>
<xsl:apply-templates select="origin/localityStack"/>
<xsl:apply-templates select="modification"/>
<xsl:apply-templates select="modification"/> -->
</tbx:source>
</xsl:template>

<xsl:template match="origin">
<xsl:call-template name="eref"/>
</xsl:template>

<xsl:template match="localityStack">
<xsl:text>, </xsl:text>
<xsl:for-each select="locality">
Expand All @@ -2101,10 +2106,16 @@
</xsl:template>

<xsl:template match="modification">
<xsl:text>, modified — </xsl:text>
<xsl:apply-templates />
<xsl:text>, modified</xsl:text>
<xsl:variable name="modification_text">
<xsl:apply-templates />
</xsl:variable>
<xsl:if test="normalize-space($modification_text) != ''">
<xsl:text> — </xsl:text>
<xsl:copy-of select="$modification_text"/>
</xsl:if>
</xsl:template>

<xsl:template match="modification/text()[normalize-space() = '']"/> <!-- linearization -->

<!-- <xsl:template match="*[local-name() = 'termexample'] | *[local-name() = 'termnote'] | *[local-name() = 'termsource']"/> -->

Expand Down Expand Up @@ -2427,7 +2438,7 @@
<!-- ======================-->
<!-- eref processing -->
<!-- ===================== -->
<xsl:template match="eref">
<xsl:template match="eref" name="eref">

<xsl:variable name="model_eref_">
<xsl:call-template name="build_metanorma_model_eref"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/sts2mn.common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- std model processing -->
<!-- ================= -->

<!-- build term's source model:
<!-- build std model:
reference - link to bibliography item
referenceText - text for displaying (if it's difference from bibliography item text)
locality - example: clause=2.5
Expand Down

0 comments on commit 8695a81

Please sign in to comment.