Skip to content

Commit

Permalink
Merge pull request #183 from metanorma/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
Intelligent2013 authored Apr 30, 2024
2 parents 58e054c + b5b4aa2 commit 5d82d55
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 47 deletions.
56 changes: 28 additions & 28 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ You will need the `maven` build tool and `make`.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar <XML-FileName>
java -Xss5m -jar target/stepmod2mn-1.54.jar <XML-FileName>
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar data/resource_docs/draughting_elements/resource.xml
java -Xss5m -jar target/stepmod2mn-1.54.jar data/resource_docs/draughting_elements/resource.xml
----

NOTE: resulted AsciiDoc found in data/resource_docs/draughting_elements/document.adoc
Expand All @@ -34,28 +34,28 @@ NOTE: resulted AsciiDoc found in data/resource_docs/draughting_elements/document

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar <XML-FileName> [--output <AsciiDoc-FileName>]
java -Xss5m -jar target/stepmod2mn-1.54.jar <XML-FileName> [--output <AsciiDoc-FileName>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar data/resource_docs/draughting_elements/resource.xml --output result_dir/draughting_elements/document.adoc
java -Xss5m -jar target/stepmod2mn-1.54.jar data/resource_docs/draughting_elements/resource.xml --output result_dir/draughting_elements/document.adoc
----

=== Convert all resource.xml and module.xml in the specified folder and sub-folders into the Metanorma AsciiDoc format:

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar <Input-folder>
java -Xss5m -jar target/stepmod2mn-1.54.jar <Input-folder>
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar data/
java -Xss5m -jar target/stepmod2mn-1.54.jar data/
----

NOTE: the result AsciiDocs will be saved in the folder with the source resource.xml and module.xml files.
Expand All @@ -65,57 +65,57 @@ NOTE: the result AsciiDocs will be saved in the folder with the source resource.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar <Input-folder> [--output <Output-folder>]
java -Xss5m -jar target/stepmod2mn-1.54.jar <Input-folder> [--output <Output-folder>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar data/ --output documents/
java -Xss5m -jar target/stepmod2mn-1.54.jar data/ --output documents/
----


=== Convert all resource.xml and module.xml in the specified folder and sub-folders into the Metanorma AsciiDoc format, except specified documents:

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar <Input-folder> [--exclude <documents or part numbers list>]
java -Xss5m -jar target/stepmod2mn-1.54.jar <Input-folder> [--exclude <documents or part numbers list>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar data/ --exclude "machining_features 104"
java -Xss5m -jar target/stepmod2mn-1.54.jar data/ --exclude "machining_features 104"
----

=== Convert only specified documents resource.xml and module.xml in the specified folder and sub-folders into the Metanorma AsciiDoc format:

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar <Input-folder> [--include-only <documents list>]
java -Xss5m -jar target/stepmod2mn-1.54.jar <Input-folder> [--include-only <documents list>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar data/ --include-only "fundamentals_of_product_description_and_support kinematics"
java -Xss5m -jar target/stepmod2mn-1.54.jar data/ --include-only "fundamentals_of_product_description_and_support kinematics"
----

=== Generate Metanorma collection files (metanorma.yml and collection.yml) for the documents specified in the publication index xml file in the tags 'resource_docs' and 'modules':

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar <Publication-Index-XML-FileName>
java -Xss5m -jar target/stepmod2mn-1.54.jar <Publication-Index-XML-FileName>
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar publication/part1000/CR_PMI_5/publication_index.xml
java -Xss5m -jar target/stepmod2mn-1.54.jar publication/part1000/CR_PMI_5/publication_index.xml
----

NOTE: the Metanorma collection files .yml will be saved in the 3 level up folder (usually, source repository's root folder).
Expand All @@ -125,14 +125,14 @@ and save them into the output folder:

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar <Publication-Index-XML-FileName> [--output <Output-folder>]
java -Xss5m -jar target/stepmod2mn-1.54.jar <Publication-Index-XML-FileName> [--output <Output-folder>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar iso-10303-srl/iso-10303-stepmod-wg12/publication/part1000/CR_PMI_5/publication_index.xml --output iso-10303-srl/
java -Xss5m -jar target/stepmod2mn-1.54.jar iso-10303-srl/iso-10303-stepmod-wg12/publication/part1000/CR_PMI_5/publication_index.xml --output iso-10303-srl/
----

NOTE: the output folder should contains the folder with the generated .adoc (usually, 'documents'). You can specify this folder obviously by the parameter '--input-documents':
Expand All @@ -141,7 +141,7 @@ e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar iso-10303-srl/iso-10303-stepmod-wg12/publication/part1000/CR_PMI_5/publication_index.xml --output iso-10303-srl/CR_PMI_5 --input-documents iso-10303-srl/documents
java -Xss5m -jar target/stepmod2mn-1.54.jar iso-10303-srl/iso-10303-stepmod-wg12/publication/part1000/CR_PMI_5/publication_index.xml --output iso-10303-srl/CR_PMI_5 --input-documents iso-10303-srl/documents
----

NOTE: the Metanorma collection files (.yml) will be saved in the folder 'iso-10303-srl/CR_PMI_5' and the references point to the documents in the folder iso-10303-srl/documents.
Expand All @@ -151,14 +151,14 @@ NOTE: the Metanorma collection files (.yml) will be saved in the folder 'iso-103

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar <Publication-Index-XML-FileName> [--type <resource_docs or modules>]
java -Xss5m -jar target/stepmod2mn-1.54.jar <Publication-Index-XML-FileName> [--type <resource_docs or modules>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.53.jar publication/part1000/CR_PMI_5/publication_index.xml --type resource_docs
java -Xss5m -jar target/stepmod2mn-1.54.jar publication/part1000/CR_PMI_5/publication_index.xml --type resource_docs
----

NOTE: the Metanorma collection file 'metanorma.yml' will be saved in the 3 level up folder (usually, source repository's root folder).
Expand All @@ -168,42 +168,42 @@ NOTE: the Metanorma collection file 'metanorma.yml' will be saved in the 3 level

[source,sh]
----
java -jar target/stepmod2mn-1.53.jar <start folder to process xml maps files> --svg
java -jar target/stepmod2mn-1.54.jar <start folder to process xml maps files> --svg
----

e.g.

[source,sh]
----
java -jar target/stepmod2mn-1.53.jar data/resources --svg
java -jar target/stepmod2mn-1.54.jar data/resources --svg
----

=== Generate SVG images for the XML in the specified folder and sub-folders, and save them in the output folder:

[source,sh]
----
java -jar target/stepmod2mn-1.53.jar <start folder to process xml maps files> --svg [--output <Output-folder>]
java -jar target/stepmod2mn-1.54.jar <start folder to process xml maps files> --svg [--output <Output-folder>]
----

e.g.

[source,sh]
----
java -jar target/stepmod2mn-1.53.jar data/resources --svg --output schemas/
java -jar target/stepmod2mn-1.54.jar data/resources --svg --output schemas/
----

=== Generate SVG image for Express Imagemap XML and Image:

[source,sh]
----
java -jar stepmod2mn-1.53.jar --xml <Express Imagemap XML file path> --image <Image file name> [--svg <resulted SVG map file or folder>]
java -jar stepmod2mn-1.54.jar --xml <Express Imagemap XML file path> --image <Image file name> [--svg <resulted SVG map file or folder>]
----

e.g.

[source,sh]
----
java -jar stepmod2mn-1.53.jar --xml data\resource_docs\fundamentals_of_product_description_and_support\schema_diagexpg1.xml --image schema_diagexpg1.gif --svg schema_diagexpg1.svg
java -jar stepmod2mn-1.54.jar --xml data\resource_docs\fundamentals_of_product_description_and_support\schema_diagexpg1.xml --image schema_diagexpg1.gif --svg schema_diagexpg1.svg
----


Expand All @@ -223,7 +223,7 @@ Update version in `pom.xml`, e.g.:
----
<groupId>org.metanorma</groupId>
<artifactId>stepmod2mn</artifactId>
<version>1.53</version>
<version>1.54</version>
<name>STEPmod XML to Metanorma AsciiDoc converter</name>
----

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

[source,xml]
----
git tag v1.53
git push origin v1.53
git tag v1.54
git push origin v1.54
----

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>stepmod2mn</artifactId>
<version>1.53</version>
<version>1.54</version>
<name>STEPmod XML to Metanorma AsciiDoc converter</name>
<packaging>jar</packaging>
<url>https://www.metanorma.org</url>
Expand Down
14 changes: 11 additions & 3 deletions src/main/resources/stepmod.base_xsl/common.xsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
$Id: common.xsl,v 1.204 2018/10/07 10:51:54 mike Exp $
$Id: common.xsl,v 1.209 2020/02/22 00:08:47 tom Exp $
Author: Rob Bodington, Eurostep Limited
Owner: Developed by Eurostep and supplied to NIST under contract.
Purpose: Templates that are common to most other stylesheets
Expand Down Expand Up @@ -3444,6 +3444,14 @@ width="20" height="20"/> -->
<xsl:value-of
select="concat($orgname,' 10303-',$part)"/>
</xsl:when>
<xsl:when test="$status='DIS'">
<xsl:value-of
select="concat($orgname,'/',$status,' 10303-',$part)"/>
</xsl:when>
<xsl:when test="$status='CD'">
<xsl:value-of
select="concat($orgname,'/',$status,' 10303-',$part)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="concat($orgname,'/',$status,' 10303-',$part)"/>
Expand Down Expand Up @@ -3649,7 +3657,7 @@ width="20" height="20"/> -->
<xsl:value-of select="normalize-space(/module/@sc4.working_group)"/>
</xsl:when>
<xsl:when test="/application_protocol">
<xsl:value-of select="string('3')"/>
<xsl:value-of select="string('12')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('12')"/>
Expand Down Expand Up @@ -5430,7 +5438,7 @@ is case sensitive.')"/>
-->
<xsl:template match="ulink">
<xsl:text>Available from the World Wide Web: </xsl:text>
<xsl:text>Available at: </xsl:text>
<xsl:variable name="href" select="normalize-space(.)"/>

<!-- &lt;<a href="{$href}"><xsl:value-of select="$href"/></a>&gt;<xsl:text/> -->
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/stepmod.base_xsl/common/biblio.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates select="pubdate"/>
<xsl:text>.</xsl:text>
<!--<xsl:text>.</xsl:text> MWD 2020-01-07 -->
</xsl:template>
<!-- item is a technical report -->
<xsl:template match="bibitem.techreport" mode="bibitem_content">
Expand Down Expand Up @@ -292,7 +292,7 @@
</xsl:if>
</xsl:template>
<xsl:template match="ulink">
<xsl:text> Available from the World Wide Web: </xsl:text>
<xsl:text> Available at: </xsl:text>
<xsl:variable name="href" select="normalize-space(.)"/>
<xsl:text>&lt;</xsl:text>
<a href="{$href}">
Expand Down Expand Up @@ -360,7 +360,7 @@
</xsl:choose> -->

<xsl:variable name="bibitem_nodes" select="xalan:nodeset($bibitems)"/>
<xsl:if test="$bibitem_nodes//bibitem[@published='n']">
<!-- <xsl:if test="$bibitem_nodes//bibitem[@published='n']">
<table width="200">
<tr>
<td>
Expand All @@ -375,7 +375,7 @@
</td>
</tr>
</table>
</xsl:if>
</xsl:if> -->

</xsl:template>
<!-- collect up all bibitems in order to check for unpublished bib items -->
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/stepmod.base_xsl/elt_list.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="./document_xsl.xsl" ?>
<!-- <?xml-stylesheet type="text/xsl" href="./document_xsl.xsl" ?> -->
<!--
$Id: sect_biblio.xsl,v 1.25 2010/02/23 14:18:30 radack Exp $
$Id: elt_list.xsl,v 1.2 2020/01/09 16:35:27 mike Exp $
-->
<!-- Updated: Alexander Dyuzhev, for stepmod2mn tool-->

Expand Down Expand Up @@ -110,7 +110,7 @@
<xsl:otherwise>
<xsl:copy-of select="$preceding_content_processed"/>
<xsl:if test="(string-length($terminator) > 0) and (substring($preceding_content_str,string-length($preceding_content_str)) != $terminator)">
<xsl:value-of select="$terminator"/>
<!--<xsl:value-of select="$terminator"/> MWD 2020-01-08 -->
</xsl:if>
</xsl:otherwise>
</xsl:choose>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/stepmod.base_xsl/express.xsl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="./document_xsl.xsl" ?>
<!-- <?xml-stylesheet type="text/xsl" href="./document_xsl.xsl" ?> -->

<!--
$Id: express.xsl,v 1.14 2004/02/05 14:41:35 robbod Exp $
$Id: express.xsl,v 1.15 2006/11/14 21:49:06 mikeward Exp $
Author: Rob Bodington, Eurostep Limited
Owner: Developed by Eurostep and supplied to NIST under contract.
Purpose: Display the express for an Integrated Resource schema
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/stepmod.base_xsl/express_code.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-stylesheet type="text/xsl" href="./document_xsl.xsl" ?>

<!--
$Id: express_code.xsl,v 1.70 2009/08/17 14:43:22 robbod Exp $
$Id: express_code.xsl,v 1.72 2019/10/09 19:44:34 tom Exp $
Author: Rob Bodington, Eurostep Limited
Owner: Developed by Eurostep and supplied to NIST under contract.
Expand Down Expand Up @@ -223,6 +223,9 @@
<xsl:choose>
<xsl:when test="string-length($reference)>0">
<xsl:if test="not(starts-with($reference,'ISO 10303-')) and
not(starts-with($reference,'ISO/CD 10303-')) and
not(starts-with($reference,'ISO/DIS 10303-')) and
not(starts-with($reference,'ISO/FDIS 10303-')) and
not(starts-with($reference,'ISO 13584-')) and
not(starts-with($reference,'ISO 15926-'))">
<xsl:call-template name="error_message">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="./document_xsl.xsl" ?>
<!--
$Id: express_description.xsl,v 1.53 2016/08/26 10:19:51 mikeward Exp $
$Id: express_description.xsl,v 1.54 2016/09/09 13:05:25 mikeward Exp $
Author: Rob Bodington, Eurostep Limited
Owner: Developed by Eurostep and supplied to NIST under contract.
Purpose:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/stepmod.base_xsl/express_link.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-stylesheet type="text/xsl" href="./document_xsl.xsl" ?>

<!--
$Id: express_link.xsl,v 1.25 2017/07/25 10:07:13 mikeward Exp $
$Id: express_link.xsl,v 1.26 2019/05/31 12:55:00 mike Exp $
Author: Rob Bodington, Eurostep Limited
Owner: Developed by Eurostep and supplied to NIST under contract.
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/stepmod.base_xsl/expressg_icon.xsl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="./document_xsl.xsl" ?>
<!-- <?xml-stylesheet type="text/xsl" href="./document_xsl.xsl" ?> -->

<!--
$Id: expressg_icon.xsl,v 1.13 2014/06/13 12:58:59 nigelshaw Exp $
$Id: expressg_icon.xsl,v 1.14 2014/06/16 12:15:54 mikeward Exp $
Author: Rob Bodington, Eurostep Limited
Owner: Developed by Eurostep
Purpose: Read the are maps in an image and create a node list. This is
Expand Down
Loading

0 comments on commit 5d82d55

Please sign in to comment.