Skip to content

Commit

Permalink
xslt updated for IEC processing, #95
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 committed Nov 16, 2021
1 parent e8ca23b commit c4794e2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
16 changes: 8 additions & 8 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.12.0.jar xml_file --check-type xsd-niso
java -jar mnconvert-1.13.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 @@ -24,7 +24,7 @@ java -jar mnconvert-1.12.0.jar xml_file --check-type xsd-niso

[source,sh]
----
java -jar mnconvert-1.12.0.jar xml_file [options]
java -jar mnconvert-1.13.0.jar xml_file [options]
----

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

[source,sh]
----
java -jar mnconvert-1.12.0.jar xml_file [options]
java -jar mnconvert-1.13.0.jar xml_file [options]
----

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

[source,sh]
----
java -jar mnconvert-1.12.0.jar xml_file [options]
java -jar mnconvert-1.13.0.jar xml_file [options]
----

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

[source,sh]
----
java -jar target/mnconvert-1.12.0.jar tests/iso-tc154-8601-1-en.xml --output tests/iso-tc154-8601-1-en.out.xml
java -jar target/mnconvert-1.13.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 or XML2RFC) determines programmatically by root element of input file: +
Expand Down Expand Up @@ -98,7 +98,7 @@ Update version in `pom.xml`, e.g.:
----
<groupId>org.metanorma</groupId>
<artifactId>mnconvert</artifactId>
<version>1.12.0</version>
<version>1.13.0</version>
<name>Metanorma XML to NISO STS XML two-directional converter</name>
----

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

[source,xml]
----
git tag v1.12.0
git push origin v1.12.0
git tag v1.13.0
git push origin v1.13.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.12.0</version>
<version>1.13.0</version>
<name>Metanorma XML to NISO STS XML two-directional and XML2RFC to Metanorma Asciidoc IETF converter</name>
<packaging>jar</packaging>
<url>https://www.metanorma.org</url>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/mn2sts.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1917,6 +1917,7 @@
<xsl:template match="expression | expression/name" priority="2">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="*[self::expression or self::preferred or self::admitted or self::deprecates or self::domain]/text()[normalize-space() = ''] | expression/name/text()[normalize-space() = '']" priority="2"/>

<xsl:template match="p" name="p">
<!-- <xsl:if test="$debug = 'true'">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/sts2mn.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@

<xsl:variable name="name_lc" select="normalize-space(java:toLowerCase(java:java.lang.String.new($name)))"/>
<xsl:choose>
<xsl:when test="$name_lc = 'warning' or $name_lc = 'caution'">
<xsl:when test="$name_lc != '' and not(starts-with($name_lc, 'note'))">
<admonition type="{$name_lc}">
<xsl:copy-of select="@id"/>
<xsl:apply-templates />
Expand Down

0 comments on commit c4794e2

Please sign in to comment.