Skip to content

Commit

Permalink
Merge pull request #402 from metanorma/update
Browse files Browse the repository at this point in the history
updated for letter-symbol support, #230
  • Loading branch information
Intelligent2013 authored Dec 2, 2023
2 parents bdf6964 + 7d10203 commit 0c60c69
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
22 changes: 11 additions & 11 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You will need the `maven` build tool and `make`.

[source,sh]
----
java -jar mnconvert-1.57.0.jar xml_file --check-type xsd-niso
java -jar mnconvert-1.58.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 @@ -37,7 +37,7 @@ java -jar mnconvert-1.44.0.jar xml_file --validation-against <path DTD or XSD>

[source,sh]
----
java -jar mnconvert-1.57.0.jar xml_file [options]
java -jar mnconvert-1.58.0.jar xml_file [options]
----

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

[source,sh]
----
java -jar mnconvert-1.57.0.jar xml_file [options]
java -jar mnconvert-1.58.0.jar xml_file [options]
----

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

[source,sh]
----
java -jar mnconvert-1.57.0.jar xml_file [options]
java -jar mnconvert-1.58.0.jar xml_file [options]
----

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

[source,sh]
----
java -jar mnconvert-1.57.0.jar docx_file [options]
java -jar mnconvert-1.58.0.jar docx_file [options]
----

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

----
java -jar mnconvert-1.57.0.jar xml_file [options]
java -jar mnconvert-1.58.0.jar xml_file [options]
----

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

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

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

[source,sh]
----
java -jar target/mnconvert-1.57.0.jar tests/iso-tc154-8601-1-en.xml --output tests/iso-tc154-8601-1-en.out.xml
java -jar target/mnconvert-1.58.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 @@ -151,7 +151,7 @@ Update version in `pom.xml`, e.g.:
----
<groupId>org.metanorma</groupId>
<artifactId>mnconvert</artifactId>
<version>1.57.0</version>
<version>1.58.0</version>
<name>Metanorma XML to NISO STS XML two-directional converter</name>
----

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

[source,xml]
----
git tag v1.57.0
git push origin v1.57.0
git tag v1.58.0
git push origin v1.58.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.57.0</version>
<version>1.58.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
2 changes: 1 addition & 1 deletion src/main/resources/mn2sts.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@

<xsl:variable name="value">
<xsl:choose>
<xsl:when test="letter-symbol">symbol</xsl:when>
<xsl:when test="letter-symbol = 'symbol' or letter-symbol = 'formula' or letter-symbol = 'equation'"><xsl:value-of select="letter-symbol"/></xsl:when>
<xsl:when test=".//abbreviation-type = 'acronym'">acronym</xsl:when>
<xsl:when test=".//expression/@type = 'abbreviation'">abbreviation</xsl:when>
<xsl:when test="($metanorma_type = 'IEC' or $metanorma_type = 'ISO' or $metanorma_type = 'BSI') and .//expression/@type = 'full'">fullForm</xsl:when> <!-- or normalize-space(.//expression/@type) = '') -->
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/mn2xml.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2143,6 +2143,7 @@
contributor/organization/subdivision |
contributor/organization/identifier |
contributor/role/text() |
contributor/role/description |
ext/structuredidentifier/project-number |
language |
script |
Expand Down
10 changes: 7 additions & 3 deletions src/main/resources/sts2mn.adoc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2535,16 +2535,20 @@
<xsl:text>abbreviation-type:: </xsl:text><xsl:value-of select="@value"/>
</xsl:when>
<xsl:when test="@value = 'symbol'">
<xsl:text>letter-symbol:: true</xsl:text>
<xsl:text>letter-symbol:: symbol</xsl:text>
</xsl:when>
<xsl:when test="@value = 'formula'">
<xsl:text>letter-symbol:: formula</xsl:text>
</xsl:when>
<xsl:when test="@value = 'equation'">
<xsl:text>letter-symbol:: equation</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>type:: </xsl:text>
<xsl:choose>
<xsl:when test="@value = 'fullForm'">
<xsl:text>full</xsl:text>
</xsl:when>
<!-- <xsl:when test="@value = 'formula'">
<xsl:when test="@value = 'equation'"> -->
<xsl:when test="@value = 'variant'">full</xsl:when>
<xsl:otherwise><xsl:value-of select="@value"/></xsl:otherwise> <!-- Example: abbreviation -->
</xsl:choose>
Expand Down

0 comments on commit 0c60c69

Please sign in to comment.