Project

ojxv

0.0
The project is in a healthy, maintained state
A library to validate XML outputs in the Open Journals' publishing pipeline
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.1.0
~> 5.21

Runtime

~> 1.16.0
 Project Readme

OJXV: Open Journals XML Validator

OJXV validates Open Journals' publishing pipeline XML outputs (JATS and Crossref).

CI Gem Version

Installation

gem install ojxv

Usage

OJXV can be used to validate JATS and Crossref XML files against the following schema versions:

  • JATS:
    • 1.1
    • 1.1d1
    • 1.1d2
    • 1.1d3
    • 1.2
    • 1.2d1
    • 1.2d2
    • 1.3d1
    • 1.3
  • Crossref:
    • 4.8.0
    • 4.8.1
    • 5.1.0
    • 5.2.0
    • 5.3.0
    • 5.3.1

Validating JATS files

Use the OJXV::JatsFile class:

require "ojxv"

jats_file_path = "example/paper.jats"

jats_file = OJXV::JatsFile.new(jats_file_path)

# By default validation is performed against JATS v1.3
jats_file.valid_jats? #=> true / false

# Validating against a specific schema version:
jats_file.valid_jats?("1.2") #=> true / false

# After validating, errors can be queried:
jats_file.errors #=> [] / ["Error: missing element article", "Error: invalid namespace", ...]

Validating Crossref XML files

Use the OJXV::CrossrefMetadataFile class:

require "ojxv"

crossref_file_path = "example/paper.crossref"

crossref_file = OJXV::CrossrefMetadataFile.new(crossref_file_path)

# By default validation is performed against Crossref 5.3.1
crossref_file.valid_crossref? #=> true / false

# Validating against a specific schema version:
crossref_file.valid_crossref?("4.8.0") #=> true / false

# After validating, errors can be queried:
crossref_file.errors #=> [] / ["Error: missing element article", "Error: invalid namespace", ...]

License

Released under a MIT License - © Juanjo Bazán