Skip to content

Commit

Permalink
JIS xslt updated for example, metanorma/metanorma-jis#3
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 committed Mar 26, 2023
1 parent 58505d7 commit c61c329
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
41 changes: 41 additions & 0 deletions xslt_src/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,10 @@
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
<xsl:attribute name="text-align">justify</xsl:attribute>
</xsl:if>
<xsl:if test="$namespace = 'jis'">
<xsl:attribute name="margin-top">4pt</xsl:attribute>
<xsl:attribute name="margin-bottom">4pt</xsl:attribute>
</xsl:if>
<xsl:if test="$namespace = 'm3d'">
<xsl:attribute name="margin-top">14pt</xsl:attribute>
<xsl:attribute name="margin-bottom">14pt</xsl:attribute>
Expand Down Expand Up @@ -1173,6 +1177,10 @@
<xsl:attribute name="font-size">10pt</xsl:attribute>
<xsl:attribute name="margin-top">12pt</xsl:attribute>
</xsl:if>
<xsl:if test="$namespace = 'jis'">
<xsl:attribute name="margin-top">4pt</xsl:attribute>
<xsl:attribute name="margin-bottom">4pt</xsl:attribute>
</xsl:if>
<xsl:if test="$namespace = 'm3d'">
<xsl:attribute name="margin-top">8pt</xsl:attribute>
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
Expand Down Expand Up @@ -1269,6 +1277,9 @@
<xsl:attribute name="keep-with-next">always</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:if>
<xsl:if test="$namespace = 'jis'">
<xsl:attribute name="font-family">IPAexGothic</xsl:attribute>
</xsl:if>
<xsl:if test="$namespace = 'm3d'">
<xsl:attribute name="padding-right">5mm</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
Expand Down Expand Up @@ -1393,6 +1404,9 @@
<xsl:attribute name="padding-right">9mm</xsl:attribute>
<xsl:attribute name="font-style">italic</xsl:attribute>
</xsl:if>
<xsl:if test="$namespace = 'jis'">
<xsl:attribute name="font-family">IPAexGothic</xsl:attribute>
</xsl:if>
<xsl:if test="$namespace = 'm3d'">
<xsl:attribute name="padding-right">1mm</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
Expand Down Expand Up @@ -13185,6 +13199,7 @@
<xsl:otherwise>block</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$namespace= 'jis'">list</xsl:when>
<xsl:otherwise>block</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Expand All @@ -13211,6 +13226,27 @@
</fo:block-container>
</xsl:when> <!-- end block -->

<xsl:when test="contains(normalize-space($fo_element), 'list')">
<fo:list-block provisional-distance-between-starts="{10 + $text_indent}mm">
<fo:list-item>
<fo:list-item-label start-indent="{$text_indent}mm" end-indent="label-end()">
<fo:block>
<xsl:apply-templates select="*[local-name()='name']">
<xsl:with-param name="fo_element">block</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates select="node()[not(local-name() = 'name')]">
<xsl:with-param name="fo_element" select="$fo_element"/>
</xsl:apply-templates>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</xsl:when> <!-- end list -->

<xsl:otherwise> <!-- inline -->

<!-- display 'EXAMPLE' and first element in the same line -->
Expand Down Expand Up @@ -13300,6 +13336,11 @@
</fo:block>
</fo:block-container>
</xsl:when>
<xsl:when test="starts-with(normalize-space($element), 'list')">
<fo:block xsl:use-attribute-sets="example-p-style">
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:inline xsl:use-attribute-sets="example-p-style">
<xsl:apply-templates/>
Expand Down
4 changes: 3 additions & 1 deletion xslt_src/jis.international-standard.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,9 @@
<xsl:template match="jis:note/jis:name/text() |
jis:term/jis:preferred//text() |
jis:termnote/jis:name/text() |
jis:table/jis:name/text()" mode="update_xml_step1">
jis:table/jis:name/text() |
jis:example/jis:name/text() |
jis:termexample/jis:name/text()" mode="update_xml_step1">
<xsl:variable name="regex_en">([^\u3000-\u9FFF\uF900-\uFFFF]{1,})</xsl:variable>
<xsl:variable name="element_name_font_en">font_en</xsl:variable>
<xsl:variable name="tag_font_en_open">###<xsl:value-of select="$element_name_font_en"/>###</xsl:variable>
Expand Down

0 comments on commit c61c329

Please sign in to comment.