Skip to content

metanorma/mnconvert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metanorma mnconvert

Usage

1. Check ISO/NISO STS XML against XSD, DTD.

java -jar mnconvert-1.66.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)

  • --idrefchecking, -idref - Enable checking of ID/IDREF constraints (for XSD NISO only)

  • --tagset, -ts - use Interchange (value 'interchange', default) or Extended (value 'extended') NISO STS Tag Set in NISO DTD/XSD validation

  • --mathml, -m - use MathML version 2 (value '2') or 3 (value '3', default) in NISO DTD/XSD validation

or check any XML against XSD, DTD.

java -jar mnconvert-1.66.0.jar xml_file --validation-against <path DTD or XSD>
  • --validation-against, -va - Check against specified DTD ot XSD

  • --idrefchecking, -idref - Enable checking of ID/IDREF constraints (for XSD only)

2. Convert ISO/NISO STS XML to Metanorma XML or Metanorma AsciiDoc.

java -jar mnconvert-1.66.0.jar xml_file [options]
  • --xsl-file, -s - path to XSL file, optional

  • --output, -o - path to output file, optional

  • --output-format, -of - xml|adoc(default), optional

  • --imagesdir, -img - folder with images (default 'images'), optional

  • --split-bibdata, -sb - create Metanorma AsciiDoc and Relaton XML, both with document’s attributes only, optional

  • --type, -st - type of standard to generate (iso, bsi, etc.), optional

  • --semantic, -sx - generate semantic Metanorma XML instead of presentation Metanorma XML (for xml output format only)

3. Convert Metanorma XML to ISO/NISO STS XML.

java -jar mnconvert-1.66.0.jar xml_file [options]
  • --xsl-file, -s - path to XSL file, optional

  • --output, -o - path to output file, optional

  • --output-format, -of - iso|niso(default), optional

  • --check-type, -ct - check against XSD NISO (value 'xsd-niso', default), DTD ISO (value 'dtd-iso'), DTD NISO (value 'dtd-niso')

  • --idrefchecking, -idref - Enable checking of ID/IDREF constraints (for XSD NISO only)

  • --tagset, -ts - use Interchange (value 'interchange', default) or Extended (value 'extended') NISO STS Tag Set in NISO DTD/XSD validation

  • --mathml, -m - use MathML version 2 (value '2') or 3 (value '3', default) in NISO DTD/XSD validation

4. Converting from RFC XML version 2 (and v3 later…​) to Metanorma AsciiDoc.

java -jar mnconvert-1.66.0.jar xml_file [options]
  • --xsl-file, -s - path to XSL file, optional

  • --output, -o - path to output file, optional

5. Convert from DOCX (ISO Simple Template and ISO Edited DIS Template) to Metanorma AsciiDoc.

java -jar mnconvert-1.66.0.jar docx_file [options]
  • --xsl-file, -s - path to XSL file, optional

  • --output, -o - path to output file, optional

6. Convert from IEEE STL XML to Metanorma AsciiDoc.

java -jar mnconvert-1.66.0.jar xml_file [options]
  • --xsl-file, -s - path to XSL file, optional

  • --output, -o - path to output file, optional

  • --imagesdir, -img - folder with images (default 'images'), optional

7. Convert Metanorma xml to IEEE STL XML.

java -jar mnconvert-1.66.0.jar xml_file --output-format ieee --validation-against <path to IEEE DTD>
  • --xsl-file, -s - path to XSL file, optional

  • --output, -o - path to output file, optional

  • --output-format, -of - ieee

  • --validation-against, -va - Check against specified IEEE DTD

Common options:

  • --version, -v - display application version, optional

  • --debug, -d turn-on debug mode (print additional debug information into output file), optional

e.g.

java -jar target/mnconvert-1.66.0.jar tests/iso-tc154-8601-1-en.xml --output tests/iso-tc154-8601-1-en.out.xml --output-format ieee
Note
Input XML format (Metanorma, STS ISO/NISO, IEEE or XML2RFC) determines programmatically by root element of input file:
- Metanorma XML - *-standard or metanorma-collection
- XML2RFC - rfc
- IEEE - standards-document
- ISO/STS in another cases
but you can specify it obviously by parameter --input-format, -if (values: metanorma|sts|rfc)
Note
Output format (Metanorma or STS) determines programmatically by root element of input file:
- STS NISO XML for input Metanorma XML
- Metanorma for input STS ISO/NISO XML
- Metanorma for input XML2RFC

Installing Build Tools

You will need the maven build tool and make.

Building the package

make all

Releasing a new version

Update version in pom.xml, e.g.:

<groupId>org.metanorma</groupId>
<artifactId>mnconvert</artifactId>
<version>1.66.0</version>
<name>Metanorma XML to NISO STS XML two-directional converter</name>

Build the package using instructions above, the package will be created at: target/mnconvert-{version}.jar

Tag the same version in Git:

git tag v1.66.0
git push origin v1.66.0

Then the corresponding GitHub release will be automatically created at: https://github.com/metanorma/mnconvert/releases

Testing

The testing environment utilizes these tools:

  • make

Running the tests:

make test

Ribose Inc.