metanorma / stepmod2mn

Migrating STEPmod documents to Metanorma
0 stars 1 forks source link

(URGENT) Image map files occasionally not found and generates ERROR message #105

Closed ronaldtse closed 12 months ago

ronaldtse commented 1 year ago
ERROR: Image map file schema_diagexpg1.xml(/Users/me/src/mn/iso-10303-srl/iso-10303-stepmod-wg12/data/resource_docs/draughting/schema_diagexpg1.xml) does not exist or empty!

etc.

Also, the stepmod2mn migration process triggers several errors. We need to fix ALL of them.

ronaldtse commented 1 year ago
Screenshot 2023-12-03 at 11 52 24 PM
Intelligent2013 commented 1 year ago

The error

ERROR: Image map file schema_diagexpg1.xml(/Users/me/src/mn/iso-10303-srl/iso-10303-stepmod-wg12/data/resource_docs/draughting/schema_diagexpg1.xml) does not exist or empty!

occurs due the missing map in the schema_diagexpg1.xml (the file exists), i.e. there aren't tags like <img.area shape="poly" in the <img ...:

<?xml version="1.0"?>
<?xml-stylesheet 
      type="text/xsl" 
      href="../../../xsl/res_doc/imgfile.xsl"
    ?> <!DOCTYPE imgfile.content SYSTEM "../../../dtd/text.ent">
<imgfile.content module="draughting" file="schema_diagexpg1.xml">
<img src="schema_diagexpg1.gif">

</img>
</imgfile.content>

Then I'll put the message if does not exist only.

Intelligent2013 commented 1 year ago

@ronaldtse the error:

Error: boilerplate text is empty.

relates to the 2years ago task https://github.com/metanorma/stepmod2mn/issues/10 and occurs due the missing command line parameter -- boilerplatePath <path to boilerplate text storage folder>. Actually, I'm out of context what should I do in that task....

Intelligent2013 commented 1 year ago

In some 99-bibliography.adoc there are errors like this: Bibliography error: missing reference to ....

For instance iso-10303-srl\documents\modules\condition\sections\99-bibliography.adoc:

[bibliography]
== Bibliography

_Bibliography error: missing reference to ISO/IEC 8824-1
    Add <bibitem.inc ref="ref8824-1"/>_

_Bibliography error: missing reference to Guidelines for the content of application modules
    Add <bibitem.inc ref="AMConGde06"/>_

* [[[bibitem_ISO10303-1164,ISO/TS 10303-1164]]], ISO/TS 10303-1164, Industrial automation systems and integration — Product data representation and exchange — Part 1164: Application module: Product as individual.

...

The source of these errors in common.biblio.xsl:

    <xsl:template match="bibliography">
        <xsl:param name="doc_type"/>
        <xsl:variable name="bib_file">
            <xsl:call-template name="get_bib_file">
                <xsl:with-param name="doc_type" select="$doc_type"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:choose>
            <xsl:when test="./bibitem.inc[@ref='ref8824-1']">
                <!-- bibliography contains reference to ISO/IEC 8824-1 -->
            </xsl:when>
            <xsl:otherwise>
                <xsl:call-template name="error_message">
                    <xsl:with-param name="message" select="'Bibliography error: missing reference to ISO/IEC 8824-1#Add &lt;bibitem.inc ref=&quot;ref8824-1&quot;/&gt;'"/>
                </xsl:call-template>
            </xsl:otherwise>
        </xsl:choose>
        <xsl:choose>
            <xsl:when test="$doc_type='module'">
                <xsl:if test="not(./bibitem.inc[@ref='AMConGde06'])">
                    <xsl:call-template name="error_message">
                        <xsl:with-param name="message" select="'Bibliography error: missing reference to Guidelines for the content of application modules#Add &lt;bibitem.inc ref=&quot;AMConGde06&quot;/&gt;'"/>
                    </xsl:call-template>
                </xsl:if>
            </xsl:when>
            <xsl:when test="$doc_type='AP'">
                <xsl:if test="not(./bibitem.inc[@ref='APConGde'])">
                    <xsl:call-template name="error_message">
                        <xsl:with-param name="message" select="'Bibliography error: missing reference to Guidelines for the content of application protocols that use application modules#Add &lt;bibitem.inc ref=&quot;APConGde&quot;/&gt;'"/>
                    </xsl:call-template>
                </xsl:if>
            </xsl:when>
        </xsl:choose>
        ...
    </xsl:template>

I'll add these references via XSLT automatically (i.e. XSLT will 'recovery' the missing data), and put the warning about it in the console log.

Intelligent2013 commented 1 year ago

In some 95-listings.adoc, for instance iso-10303-srl\documents\modules\cost_schedule\sections\95-listings.adoc: error Error in module.xml/module/@wg.number...:

[[table_e1]]
[cols="^,^,^,^",options="header"]
.ARM and MIM EXPRESS listings
|===
| Description | HTML file | ASCII file | Identifier

| ARM short form EXPRESS| <<arm.htm, arm.htm>>| <<arm.exp, arm.exp.exp>>| 
_(Error in module.xml/module/@wg.number. arm - Error WG-1: No WG number provided._

| MIM short form EXPRESS| <<mim.htm, mim.htm>>| <<mim.exp, mim.exp.exp>>| 
_(Error in module.xml/module/@wg.number. mim - Error WG-1: No WG number provided._

|===
Intelligent2013 commented 1 year ago

Correct error, wg.number.arm and wg.number.mim are empty:

<module
   name="cost_schedule"
   part="1390"
   version="1"
   sc4.working_group="12"
   wg.number="00000"
   wg.number.arm=""
   wg.number.mim=""
Intelligent2013 commented 1 year ago

The error Can not load requested doc:

SystemId Unknown; Line #48; Column #134; Can not load requested doc: D:\Work\Metanorma\repositories\iso-10303-srl\iso-10303-stepmod-wg12\data\modules\activity_as_realized\..\..\..\..\basic\bibliography_default.xml (The system cannot find the path specified)

The file basic\bibliography_default.xml exists.

Intelligent2013 commented 12 months ago

Fixed in https://github.com/metanorma/stepmod2mn/releases/tag/v1.26.