Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #190

Merged
merged 6 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.55.jar <XML-FileName>
java -Xss5m -jar target/stepmod2mn-1.56.jar <XML-FileName>
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.55.jar data/resource_docs/draughting_elements/resource.xml
java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar <XML-FileName> [--output <AsciiDoc-FileName>]
java -Xss5m -jar target/stepmod2mn-1.56.jar <XML-FileName> [--output <AsciiDoc-FileName>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.55.jar data/resource_docs/draughting_elements/resource.xml --output result_dir/draughting_elements/document.adoc
java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar <Input-folder>
java -Xss5m -jar target/stepmod2mn-1.56.jar <Input-folder>
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.55.jar data/
java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar <Input-folder> [--output <Output-folder>]
java -Xss5m -jar target/stepmod2mn-1.56.jar <Input-folder> [--output <Output-folder>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.55.jar data/ --output documents/
java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar <Input-folder> [--exclude <documents or part numbers list>]
java -Xss5m -jar target/stepmod2mn-1.56.jar <Input-folder> [--exclude <documents or part numbers list>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.55.jar data/ --exclude "machining_features 104"
java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar <Input-folder> [--include-only <documents list>]
java -Xss5m -jar target/stepmod2mn-1.56.jar <Input-folder> [--include-only <documents list>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.55.jar data/ --include-only "fundamentals_of_product_description_and_support kinematics"
java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar <Publication-Index-XML-FileName>
java -Xss5m -jar target/stepmod2mn-1.56.jar <Publication-Index-XML-FileName>
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.55.jar publication/part1000/CR_PMI_5/publication_index.xml
java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar <Publication-Index-XML-FileName> [--output <Output-folder>]
java -Xss5m -jar target/stepmod2mn-1.56.jar <Publication-Index-XML-FileName> [--output <Output-folder>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.55.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.56.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.55.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.56.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.55.jar <Publication-Index-XML-FileName> [--type <resource_docs or modules>]
java -Xss5m -jar target/stepmod2mn-1.56.jar <Publication-Index-XML-FileName> [--type <resource_docs or modules>]
----

e.g.

[source,sh]
----
java -Xss5m -jar target/stepmod2mn-1.55.jar publication/part1000/CR_PMI_5/publication_index.xml --type resource_docs
java -Xss5m -jar target/stepmod2mn-1.56.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.55.jar <start folder to process xml maps files> --svg
java -jar target/stepmod2mn-1.56.jar <start folder to process xml maps files> --svg
----

e.g.

[source,sh]
----
java -jar target/stepmod2mn-1.55.jar data/resources --svg
java -jar target/stepmod2mn-1.56.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.55.jar <start folder to process xml maps files> --svg [--output <Output-folder>]
java -jar target/stepmod2mn-1.56.jar <start folder to process xml maps files> --svg [--output <Output-folder>]
----

e.g.

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

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

[source,sh]
----
java -jar stepmod2mn-1.55.jar --xml <Express Imagemap XML file path> --image <Image file name> [--svg <resulted SVG map file or folder>]
java -jar stepmod2mn-1.56.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.55.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.56.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.55</version>
<version>1.56</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.55
git push origin v1.55
git tag v1.56
git push origin v1.56
----

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.55</version>
<version>1.56</version>
<name>STEPmod XML to Metanorma AsciiDoc converter</name>
<packaging>jar</packaging>
<url>https://www.metanorma.org</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,23 @@ $Id: sect_introduction.xsl,v 1.15 2020/03/02 14:39:21 tom Exp $
<xsl:text>&#xa;&#xa;</xsl:text> -->

<!-- replaced by macros -->
<xsl:text>[lutaml_express, schemas, context, leveloffset=+1]</xsl:text>
<!-- <xsl:text>[lutaml_express, schemas, context, leveloffset=+1]</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>---</xsl:text>
<xsl:text>- - -</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>{% for schema in context.schemas %}</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>* {{ schema.id }}{% if forloop.last == true %}.{% else %};{% endif %}</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>{% endfor %}</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>---</xsl:text>
<xsl:text>- - -</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>&#xa;</xsl:text> -->

<!-- https://github.com/metanorma/stepmod2mn/issues/189 -->
<!-- replaced by template -->
<xsl:text>include::../templates/resources/resource_introduction_subdivisions.adoc[]</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>&#xa;</xsl:text>

Expand Down
26 changes: 22 additions & 4 deletions src/main/resources/stepmod.base_xsl/sect_2_refs.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -638,10 +638,28 @@ $Id: sect_2_refs.xsl,v 1.22 2019/03/09 01:29:01 tom Exp $
node set. The normrefs are sorted on output -->
<xsl:template match="normref_nodes" mode="output_normrefs">

<xsl:apply-templates select="normref" mode="output_html">
<xsl:sort select="@group" data-type="text"/>
<xsl:sort select="@id" data-type="text"/>
</xsl:apply-templates>
<xsl:variable name="normative_references">
<xsl:apply-templates select="normref" mode="output_html">
<xsl:sort select="@group" data-type="text"/>
<xsl:sort select="@id" data-type="text"/>
</xsl:apply-templates>
</xsl:variable>

<xsl:copy-of select="$normative_references"/>

<xsl:variable name="normative_references_tmp" select="translate($normative_references, '&#xa0;', ' ')"/>
<xsl:if test="not(contains($normative_references_tmp, ',ISO 10303-2]]]'))">
<!-- * [[[bibitem_010303000002,ISO 10303-2]]] _Industrial automation systems and integration — Product data representation and exchange— Part 2: Vocabulary_</xsl:text> -->
<xsl:variable name="normref_10303_2"><normref.inc normref="ref10303-2"/></xsl:variable>
<xsl:variable name="normref_list">
<xsl:element name="normref_nodes">
<xsl:apply-templates select="xalan:nodeset($normref_10303_2)/*" mode="generate_node"/>
</xsl:element>
</xsl:variable>
<xsl:variable name="normref_nodes" select="xalan:nodeset($normref_list)"/>
<xsl:apply-templates select="$normref_nodes//normref" mode="output_html"/>
</xsl:if>

<xsl:apply-templates select="normref.resource" mode="check_resources"/>

<!-- <xsl:if test="normref/stdref[@published='n']">
Expand Down
13 changes: 12 additions & 1 deletion src/main/resources/stepmod.base_xsl/sect_3_defs.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,20 @@ $Id: sect_3_defs.xsl,v 1.11 2010/02/03 12:10:33 robbod Exp $
</xsl:if>
</xsl:for-each>
</xsl:variable>

<xsl:variable name="attributes">
<!-- Example: source=bibitem_010303000002 -->
<!-- <xsl:if test="xalan:nodeset($list_ref)//item[contains(., 'ISO 10303-')]">source=ref10303-2</xsl:if> -->
<xsl:if test="xalan:nodeset($list_ref_iso_10303)//item">source=ref10303-2</xsl:if>
<xsl:if test="xalan:nodeset($list_ref_iso_10303)//item">
<xsl:variable name="normref_10303_2"><normref.inc normref="ref10303-2"/></xsl:variable>
<xsl:variable name="normref_list">
<xsl:element name="normref_nodes">
<xsl:apply-templates select="xalan:nodeset($normref_10303_2)/*" mode="generate_node"/>
</xsl:element>
</xsl:variable>
<xsl:variable name="normref_nodes" select="xalan:nodeset($normref_list)"/>
<xsl:value-of select="concat('source=bibitem_', $normref_nodes//normref/@id)"/>
</xsl:if>
</xsl:variable>

<xsl:call-template name="insertHeaderADOC">
Expand Down
Loading
Loading