Skip to content

mokesano/jats-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ“„ JATS Engine

Convert DOCX Manuscripts into JATS XML for Scholarly Publishing

A PHP library that parses Microsoft Word .docx manuscripts and builds structured JATS (Journal Article Tag Suite) XML ready for scholarly publishing platforms and indexing services.


PHP Version JATS Version License Build Release


πŸ“ DOCX β†’ πŸ” Parse β†’ 🧱 Build β†’ πŸ“„ JATS XML


πŸ“– About

JATS Engine is the conversion core behind the Wizdam publishing ecosystem. It takes a Microsoft Word .docx manuscript and automatically builds a fully structured JATS XML document β€” the industry standard format for journal article interchange (ANSI/NISO Z39.96).

The engine is designed specifically to integrate with Open Journal Systems (OJS) 2.x via its native DAO layer, but its modular architecture allows it to be adapted for any PHP‑based publishing workflow.


✨ What It Does

🧱 Builder πŸ“‹ Responsibility
MetadataBuilder Reads article, author, journal, and issue data from OJS 2.x DAOs and builds the JATS <front> element β€” including journal meta, article meta, publication history, and citation list.
BodyBuilder Opens the .docx archive, parses the WordprocessingML body, and builds the JATS <body> with full section hierarchy, tables, figures, math, and inline formatting.
πŸ” Parser πŸ“‹ Responsibility
TextParser Detects heading levels via Word outline styles, parses paragraph content recursively (deep-diving through textboxes, shapes, and alternate content wrappers), and preserves bold/italic/underline formatting.
TableParser Converts Word tables into JATS <table-wrap> elements β€” including header detection, colspan/rowspan merging, and structured <thead>/<tbody> output.
MathParser Transforms Office Math Markup Language (OMML) into MathML using XSLT, then wraps it as JATS <inline-formula> or <disp-formula>.
ImageHandler Extracts images from the .docx zip, converts legacy EMF/WMF metafiles to PNG via PHP Imagick, and generates JATS <graphic> references.

πŸš€ Quick Start

Prerequisites

Software Version
PHP β‰₯ 8.1
PHP Extensions zip, xsl, dom, imagick (optional, for EMF/WMF conversion)
OJS 2.4.x (for native DAO integration)

Installation

composer require wizdam/jats-engine

Usage

use Wizdam\JatsEngine\Builders\MetadataBuilder;
use Wizdam\JatsEngine\Builders\BodyBuilder;

$articleId = 123;
$docxPath  = '/path/to/manuscript.docx';

// 1. Create DOM document with JATS root
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement('article');
$root->setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
$root->setAttribute('dtd-version', '1.1');
$dom->appendChild($root);

// 2. Build front matter from OJS database
$metadataBuilder = new MetadataBuilder($articleId);
$metadataBuilder->buildFront($dom);

// 3. Build body from DOCX
$bodyBuilder = new BodyBuilder();
$bodyBuilder->setArticleId($articleId);
$bodyBuilder->setDocxPath($docxPath);
$bodyBuilder->buildBody($dom);

// 4. Output JATS XML
echo $dom->saveXML();

πŸ§ͺ Example Output

<?xml version="1.0" encoding="UTF-8"?>
<article xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.1">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Journal of Applied Sciences</journal-title>
      </journal-title-group>
      <issn publication-format="print">1234-5678</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Solar Panel Adoption in Rural Java</article-title>
      </title-group>
      <contrib-group>...</contrib-group>
      <pub-date date-type="pub">
        <year>2026</year>
      </pub-date>
    </article-meta>
  </front>
  <body>
    <sec id="s1">
      <title>Introduction</title>
      <p>This study examines...</p>
    </sec>
  </body>
</article>

πŸ”§ Integration with Wizdam Ecosystem

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Wizdam Editorial                 β”‚
β”‚  (OJS 2.x based publishing platform)             β”‚
β”‚                                                   β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚   β”‚  Submission  │───▢│      JATS Engine         β”‚β”‚
β”‚   β”‚   (DOCX)    β”‚    β”‚  MetadataBuilder          β”‚β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  BodyBuilder              β”‚β”‚
β”‚                       β”‚  Parsers/Docx/*           β”‚β”‚
β”‚                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β”‚                                  β”‚                β”‚
β”‚                                  β–Ό                β”‚
β”‚                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚                       β”‚     JATS XML Output      β”‚β”‚
β”‚                       β”‚  (Ready for PubMed,      β”‚β”‚
β”‚                       β”‚   CrossRef, DOAJ)        β”‚β”‚
β”‚                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🀝 Contributing

Contributions are welcome! Please review our Contributing Guidelines before submitting a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/new-parser)
  3. Commit your changes (git commit -m 'Add new parser')
  4. Push to the branch (git push origin feature/new-parser)
  5. Open a Pull Request

This project follows the Contributor Covenant Code of Conduct.


πŸ”’ Security

Do not publicly disclose vulnerabilities.

Full details: SECURITY.md


πŸ“„ License

This project is licensed under the GNU General Public License v3.0 (GPL‑3.0).

Permission Condition
βœ… Free to use (commercial & non‑commercial) ⚠️ Derivative works must use the same license (copyleft)
βœ… Free to modify & redistribute ⚠️ Source code must be included when distributed

πŸ™ Acknowledgments

🏷️ Attribution πŸ”— Reference
JATS Standard ANSI/NISO Z39.96 β€” Journal Article Tag Suite
OMML2MML XSLT Office Math to MathML transformation stylesheet
Lead Developer Rochmady (mokesano)
Ecosystem Wizdam Editorial
Sangia Publishing House sangia.org


Built with ❀️ for the scholarly publishing community

GitHub Stars GitHub Forks

Β© 2026 Rochmady. Licensed under GPL‑3.0.

About

JATS Engine is the conversion core behind the Wizdam publishing ecosystem. It takes a Microsoft Word

Topics

Resources

License

GPL-3.0, MIT licenses found

Licenses found

GPL-3.0
LICENSE
MIT
LICENSE.md

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors