Project

niso-jats

0.01
The project is in a healthy, maintained state
NISO JATS format parser
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

NISO JATS Ruby library

The niso-jats library is a parser and generator for NISO JATS XML documents.

It is intended to be used to parse and generate NISO JATS XML v1.2 documents.

Installation

Add this line to your application’s Gemfile:

gem 'niso-jats'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install niso-jats

Usage

To parse a NISO JATS XML document:

require 'niso-jats'

jats = NisoJats::Document.new(File.read('jats.xml'))
puts jats.title
puts jats.abstract
puts jats.sections

To generate a NISO JATS XML document:

require 'niso-jats'

jats = NisoJats::Document.new
jats.title = 'An Article Title'
jats.abstract = 'An Article Abstract'
jats.sections = [
  NisoJats::Section.new('Section 1', 'This is the first section'),
  NisoJats::Section.new('Section 2', 'This is the second section')
]

puts jats.to_xml

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/niso-jats.

The gem is available as open source under the terms of the BSD 2-clause license.

All rights reserved. Ribose