Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xuanxu/ojxv
Open Journals XML Validator
https://github.com/xuanxu/ojxv
Last synced: 6 days ago
JSON representation
Open Journals XML Validator
- Host: GitHub
- URL: https://github.com/xuanxu/ojxv
- Owner: xuanxu
- License: mit
- Created: 2022-01-25T11:00:45.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-31T15:53:04.000Z (5 months ago)
- Last Synced: 2024-12-10T02:07:07.241Z (13 days ago)
- Language: XSLT
- Homepage:
- Size: 1000 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OJXV: Open Journals XML Validator
OJXV validates Open Journals' publishing pipeline XML outputs (JATS and Crossref).
[![CI](https://github.com/xuanxu/ojxv/actions/workflows/ci.yml/badge.svg)](https://github.com/xuanxu/ojxv/actions/workflows/ci.yml)
[![Gem Version](https://badge.fury.io/rb/ojxv.svg)](https://badge.fury.io/rb/ojxv)## Installation
```
gem install ojxv
```## Usage
OJXV can be used to validate JATS and Crossref XML files against the following schema versions:
- [JATS](https://jats.nlm.nih.gov/):
- 1.1
- 1.1d1
- 1.1d2
- 1.1d3
- 1.2
- 1.2d1
- 1.2d2
- 1.3d1
- 1.3d2
- 1.3
- [Crossref XML](https://www.crossref.org/documentation/schema-library/schema-versions/):
- 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:
```ruby
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:
```ruby
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](./LICENSE) - © Juanjo Bazán