Skip to content

Commit

Permalink
Merge pull request #415 from metanorma/issue/414
Browse files Browse the repository at this point in the history
mn2xml.xsl updated for #414
  • Loading branch information
Intelligent2013 authored Sep 10, 2024
2 parents 4fe3fa8 + 61cb938 commit 552d806
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
24 changes: 12 additions & 12 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[source,sh]
----
java -jar mnconvert-1.62.0.jar xml_file --check-type xsd-niso
java -jar mnconvert-1.63.0.jar xml_file --check-type xsd-niso
----

- `--check-type`, `-ct` - Check against XSD NISO (value xsd-niso), DTD ISO (dtd-iso), DTD NISO (dtd-niso)
Expand All @@ -19,7 +19,7 @@ or check any XML against XSD, DTD.

[source,sh]
----
java -jar mnconvert-1.62.0.jar xml_file --validation-against <path DTD or XSD>
java -jar mnconvert-1.63.0.jar xml_file --validation-against <path DTD or XSD>
----

- `--validation-against`, `-va` - Check against specified DTD ot XSD
Expand All @@ -30,7 +30,7 @@ java -jar mnconvert-1.62.0.jar xml_file --validation-against <path DTD or XSD>

[source,sh]
----
java -jar mnconvert-1.62.0.jar xml_file [options]
java -jar mnconvert-1.63.0.jar xml_file [options]
----

- `--xsl-file`, `-s` - path to XSL file, optional
Expand All @@ -45,7 +45,7 @@ java -jar mnconvert-1.62.0.jar xml_file [options]

[source,sh]
----
java -jar mnconvert-1.62.0.jar xml_file [options]
java -jar mnconvert-1.63.0.jar xml_file [options]
----

- `--xsl-file`, `-s` - path to XSL file, optional
Expand All @@ -60,7 +60,7 @@ java -jar mnconvert-1.62.0.jar xml_file [options]

[source,sh]
----
java -jar mnconvert-1.62.0.jar xml_file [options]
java -jar mnconvert-1.63.0.jar xml_file [options]
----

- `--xsl-file`, `-s` - path to XSL file, optional
Expand All @@ -71,7 +71,7 @@ java -jar mnconvert-1.62.0.jar xml_file [options]

[source,sh]
----
java -jar mnconvert-1.62.0.jar docx_file [options]
java -jar mnconvert-1.63.0.jar docx_file [options]
----

- `--xsl-file`, `-s` - path to XSL file, optional
Expand All @@ -81,7 +81,7 @@ java -jar mnconvert-1.62.0.jar docx_file [options]
=== 6. Convert from IEEE STL XML to Metanorma AsciiDoc.

----
java -jar mnconvert-1.62.0.jar xml_file [options]
java -jar mnconvert-1.63.0.jar xml_file [options]
----

- `--xsl-file`, `-s` - path to XSL file, optional
Expand All @@ -93,7 +93,7 @@ java -jar mnconvert-1.62.0.jar xml_file [options]

[source,sh]
----
java -jar mnconvert-1.62.0.jar xml_file --output-format ieee --validation-against <path to IEEE DTD>
java -jar mnconvert-1.63.0.jar xml_file --output-format ieee --validation-against <path to IEEE DTD>
----

- `--xsl-file`, `-s` - path to XSL file, optional
Expand All @@ -111,7 +111,7 @@ e.g.

[source,sh]
----
java -jar target/mnconvert-1.62.0.jar tests/iso-tc154-8601-1-en.xml --output tests/iso-tc154-8601-1-en.out.xml
java -jar target/mnconvert-1.63.0.jar tests/iso-tc154-8601-1-en.xml --output tests/iso-tc154-8601-1-en.out.xml
----

NOTE: Input XML format (Metanorma, STS ISO/NISO, IEEE or XML2RFC) determines programmatically by root element of input file: +
Expand Down Expand Up @@ -150,7 +150,7 @@ Update version in `pom.xml`, e.g.:
----
<groupId>org.metanorma</groupId>
<artifactId>mnconvert</artifactId>
<version>1.62.0</version>
<version>1.63.0</version>
<name>Metanorma XML to NISO STS XML two-directional converter</name>
----

Expand All @@ -161,8 +161,8 @@ Tag the same version in Git:

[source,xml]
----
git tag v1.62.0
git push origin v1.62.0
git tag v1.63.0
git push origin v1.63.0
----

Then the corresponding GitHub release will be automatically created at:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.metanorma</groupId>
<artifactId>mnconvert</artifactId>
<version>1.62.0</version>
<version>1.63.0</version>
<name>Metanorma XML to NISO STS XML two-directional, IEEE to Metanorma ADOC, Metanorma XML to IEEE XML, and XML2RFC to Metanorma Asciidoc IETF converter</name>
<packaging>jar</packaging>
<url>https://www.metanorma.org</url>
Expand Down
29 changes: 26 additions & 3 deletions src/main/resources/mn2xml.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -5210,7 +5210,7 @@
<!-- </table-wrap> -->
</xsl:element>

<xsl:if test="note and $wrap-element = 'array'">
<xsl:if test="(note or dl) and $wrap-element = 'array'">
<xsl:call-template name="insertTableFootNote"/>
</xsl:if>

Expand All @@ -5227,6 +5227,11 @@
</p>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="dl">
<p>
<xsl:call-template name="dl"/>
</p>
</xsl:for-each>
<xsl:for-each select="note">
<xsl:call-template name="note"/>
</xsl:for-each>
Expand Down Expand Up @@ -5339,6 +5344,7 @@
</xsl:template>

<xsl:template match="table/note" priority="2"/>
<xsl:template match="table/dl" priority="2"/>

<xsl:template match="name"/>
<xsl:template match="name" mode="table">
Expand Down Expand Up @@ -5453,7 +5459,7 @@
<!-- =============================== -->
<!-- Definitions list processing -->
<!-- =============================== -->
<xsl:template match="dl">
<xsl:template match="dl" name="dl">
<xsl:param name="skip">true</xsl:param>
<xsl:choose>
<xsl:when test="preceding-sibling::*[1][self::figure] or preceding-sibling::*[1][self::stem]">
Expand Down Expand Up @@ -5913,10 +5919,27 @@
<xsl:template match="review">
<xsl:if test="($metanorma_type = 'IEC' or $metanorma_type = 'ISO') and $format = 'NISO'">
<editing-instruction specific-use="review">
<xsl:apply-templates/>
<xsl:apply-templates mode="review"/>
</editing-instruction>
</xsl:if>
</xsl:template>

<xsl:template match="review/ul" mode="review">
<p>
<xsl:call-template name="ul"/>
</p>
</xsl:template>

<xsl:template match="review/ol" mode="review">>
<p>
<xsl:call-template name="ol"/>
</p>
</xsl:template>

<xsl:template match="review/*[not(local-name() = 'ul') and not(local-name() = 'ol')]" mode="review">
<xsl:apply-templates select="."/>
</xsl:template>


<xsl:template match="sourcecode">
<xsl:param name="skip">true</xsl:param>
Expand Down

0 comments on commit 552d806

Please sign in to comment.