Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xslt update based on metanorma/mn-native-pdf@22a38dc16cb80fc18d49d23c8a412a9e5fab188e #452

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 138 additions & 6 deletions lib/isodoc/ieee/ieee.amendment.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -5024,6 +5024,9 @@

</xsl:attribute-set>

<xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
</xsl:attribute-set>

<xsl:attribute-set name="definition-style">

</xsl:attribute-set>
Expand Down Expand Up @@ -13367,14 +13370,17 @@
</fo:block>
</xsl:template>

<xsl:template match="*[local-name() = 'domain']">
<!-- <xsl:template match="*[local-name() = 'domain']"> -->
<!-- https://github.com/metanorma/isodoc/issues/607
<fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
<xsl:text> </xsl:text> -->
<xsl:if test="not(@hidden = 'true')">
<!-- <xsl:if test="not(@hidden = 'true')">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
</xsl:template> -->

<!-- https://github.com/metanorma/isodoc/issues/632#issuecomment-2567163931 -->
<xsl:template match="*[local-name() = 'domain']"/>

<xsl:template match="*[local-name() = 'admitted']">
<fo:block xsl:use-attribute-sets="admitted-style">
Expand All @@ -13389,9 +13395,11 @@
</xsl:template>

<xsl:template name="setStyle_preferred">
<xsl:if test="*[local-name() = 'strong']">
<xsl:attribute name="font-weight">normal</xsl:attribute>
</xsl:if>

<xsl:if test="*[local-name() = 'strong']">
<xsl:attribute name="font-weight">normal</xsl:attribute>
</xsl:if>

</xsl:template>

<!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
Expand All @@ -13401,6 +13409,17 @@
</xsl:template>
<!-- End Preferred, admitted, deprecated -->

<xsl:template match="*[local-name() = 'fmt-related']">
<fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-related']/*[local-name() = 'p']" priority="4">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<!-- ========== -->
<!-- definition -->
<!-- ========== -->
Expand Down Expand Up @@ -15136,6 +15155,31 @@
<xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_pres"/>
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_pres"/>
<!-- <xsl:template match="*[local-name() = 'preferred'][following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_step1"/> -->
<xsl:template match="*[local-name() = 'preferred']" mode="update_xml_step1"/>
<!-- <xsl:template match="*[local-name() = 'preferred'][following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_pres"/> -->
<xsl:template match="*[local-name() = 'preferred']" mode="update_xml_pres"/>
<!-- <xsl:template match="*[local-name() = 'admitted'][following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_step1"/> -->
<xsl:template match="*[local-name() = 'admitted']" mode="update_xml_step1"/>
<!-- <xsl:template match="*[local-name() = 'admitted'][following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_pres"/> -->
<xsl:template match="*[local-name() = 'admitted']" mode="update_xml_pres"/>
<!-- <xsl:template match="*[local-name() = 'deprecates'][following-sibling::*[not(local-name() = 'deprecates')][1][local-name() = 'fmt-deprecates']]" mode="update_xml_step1"/> -->
<xsl:template match="*[local-name() = 'deprecates']" mode="update_xml_step1"/>
<xsl:template match="*[local-name() = 'related']" mode="update_xml_step1"/>
<!-- <xsl:template match="*[local-name() = 'deprecates'][following-sibling::*[not(local-name() = 'deprecates')][1][local-name() = 'fmt-deprecates']]" mode="update_xml_pres"/> -->
<xsl:template match="*[local-name() = 'deprecates']" mode="update_xml_pres"/>
<xsl:template match="*[local-name() = 'related']" mode="update_xml_pres"/>
<!-- <xsl:template match="*[local-name() = 'definition'][following-sibling::*[1][local-name() = 'fmt-definition']]" mode="update_xml_step1"/> -->
<xsl:template match="*[local-name() = 'definition']" mode="update_xml_step1"/>
<!-- <xsl:template match="*[local-name() = 'definition'][following-sibling::*[1][local-name() = 'fmt-definition']]" mode="update_xml_pres"/> -->
<xsl:template match="*[local-name() = 'definition']" mode="update_xml_pres"/>
<!-- <xsl:template match="*[local-name() = 'termsource'][following-sibling::*[1][local-name() = 'fmt-termsource']]" mode="update_xml_step1"/> -->
<xsl:template match="*[local-name() = 'termsource']" mode="update_xml_step1"/>
<!-- <xsl:template match="*[local-name() = 'termsource'][following-sibling::*[1][local-name() = 'fmt-termsource']]" mode="update_xml_pres"/> -->
<xsl:template match="*[local-name() = 'termsource']" mode="update_xml_pres"/>

<xsl:template match="*[local-name() = 'term'][@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_step1"/>
<xsl:template match="*[local-name() = 'term'][@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_pres"/>

<xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_step1">
<xsl:copy>
Expand Down Expand Up @@ -15180,6 +15224,94 @@
</xsl:element>
</xsl:template>

<xsl:template match="*[local-name() = 'fmt-preferred']"/>
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-preferred'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-preferred']/*[local-name() = 'p']" mode="update_xml_step1">
<xsl:element name="preferred" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:element>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_pres">
<xsl:apply-templates mode="update_xml_pres"/>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-preferred'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-preferred']/*[local-name() = 'p']" mode="update_xml_pres">
<xsl:element name="preferred" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_pres"/>
</xsl:element>
</xsl:template>

<xsl:template match="*[local-name() = 'fmt-admitted']"/>
<xsl:template match="*[local-name() = 'fmt-admitted'][*[local-name() = 'p']]" mode="update_xml_step1">
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-admitted'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-admitted']/*[local-name() = 'p']" mode="update_xml_step1">
<xsl:element name="admitted" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:element>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-admitted'][*[local-name() = 'p']]" mode="update_xml_pres">
<xsl:apply-templates mode="update_xml_pres"/>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-admitted'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-admitted']/*[local-name() = 'p']" mode="update_xml_pres">
<xsl:element name="admitted" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_pres"/>
</xsl:element>
</xsl:template>

<xsl:template match="*[local-name() = 'fmt-deprecates']"/>
<xsl:template match="*[local-name() = 'fmt-deprecates'][*[local-name() = 'p']]" mode="update_xml_step1">
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-deprecates'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-deprecates']/*[local-name() = 'p']" mode="update_xml_step1">
<xsl:element name="deprecates" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:element>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-deprecates'][*[local-name() = 'p']]" mode="update_xml_pres">
<xsl:apply-templates mode="update_xml_pres"/>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-deprecates'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-deprecates']/*[local-name() = 'p']" mode="update_xml_pres">
<xsl:element name="deprecates" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_pres"/>
</xsl:element>
</xsl:template>

<xsl:template match="*[local-name() = 'fmt-definition']"/>
<xsl:template match="*[local-name() = 'fmt-definition']" mode="update_xml_step1">
<xsl:element name="definition" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:element>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-definition']" mode="update_xml_pres">
<xsl:element name="definition" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_pres"/>
</xsl:element>
</xsl:template>

<xsl:template match="*[local-name() = 'fmt-termsource']"/>
<xsl:template match="*[local-name() = 'fmt-termsource']" mode="update_xml_step1">
<xsl:element name="termsource" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:element>
</xsl:template>
<xsl:template match="*[local-name() = 'fmt-termsource']" mode="update_xml_pres">
<xsl:element name="termsource" namespace="{$namespace_full}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_pres"/>
</xsl:element>
</xsl:template>

<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:template>
Expand Down
Loading
Loading