Re: [jats-list] how to identify a XML file as JATS

Subject: Re: [jats-list] how to identify a XML file as JATS
From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx>
Date: Tue, 24 Sep 2013 19:11:09 +0200
Hi Matteo,

if youbre using emacs nxml mode, you need to convert the .rng files to .rnc (Relax NG compact syntax). You may use to convert it. Or I can send you the converted files b I just tested whether it works on the JATS .rng files.

Then you have to set up schema association rules for nxml.

You can put a file schemas.xml in your working directory, like this:
<locatingRules xmlns="";>
<uri pattern="*.jats.xml" uri="file:/home/gerrit/XML/JATS/schema/JATS_Archiving_1.0/rnc/JATS-archivearticle1.rnc"/>

It should be possible to store these rules centrally for emacs, but they are somewhat limited in the criteria upon which you can make nxml select a certain schema.

Otherwise, you may use the xml-model processing instruction after the XML declaration in order to associate a Relax NG schema with the XML file, like this:

<?xml-model href="file:/c:/cygwin/home/gerrit/XML/JATS/schema/JATS_Archiving_1.0/rng/JATS-archivearticle1.rng" type="application/xml" schematypens="";?>

But few applications honor this PI. oXygen XML editor is a notable exception.

You donbt have to include a schema declaration at all in the file. You just invoke jing with the schema and the file location.

If the DOCTYPE declaration is present, most XML parsers will look for the DTD in order to resolve named entity references. You may not supply a schema of another type than DTD in the DOCTYPE declaration. But you may well drop the DOCTYPE declaration altogether.

If you use xlink:href attributes in the document, you may need to declare xmlns:xlink=""; in your document which didnbt seem to be necessary with the DTD (to my surprise).

Hope this helps.


On 24.09.2013 17:34, Matteo Gamboz wrote:
Hi all,
   I'm a bit new to XML and was wandering how to best identify a
certain XML file as implementing JATS.

At the moment I'm using this document type declaration:

  "Journal Archiving and Interchange Tag Library NISO JATS version 1.0"

Since I prefer to validate against RNG schema, I tried to substitute
the link above with:

But then I end up with validation errors on the linked rng file (using
"jing" and "xmllint", but not with "emacs" (which doesnt seem to test
it anyway)).

I'm not even sure wheter DOCTYPE is the best option here.

Could anyone point me in the right direction?


-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx,

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

GeschC$ftsfC<hrer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard VC6ckler

Current Thread