Downloadable NLM StyleChecker
Latest Version to Download
This downloadable version of the NLM StyleChecker is a single XSL transform that can be used to check the XML tagging style for regular PMC articles, manuscripts, and books (<book>
and <book-part>
based).
The transform will test an XML file against a set of templates and create an output XML file with the root element <ERR>
, which is a copy of the original file. Where style non-compliance occurs in the original file, the transform will insert either an <error>
or <warning>
element, with a human-readable comment.
You should be using a validating XSL processor because several of the tests depend on the id() function. We are using Saxon in the PMC production area to run this transform. It would be good to make sure you are validating the files against the DTD at the first transform.
This transform will apply the appropriate set of rules for the content that it is running against. The complete PMC Tagging Guidelines defines the rules for content tagged in JATS v1.3, v1.2, v1.1, v1.0, NLM DTD v3.0, and NLM DTD v2.3, as well as for books tagged in BITS v2.0. The Tagging Guidelines are available here:
- PubMed Central: https://www.ncbi.nlm.nih.gov/pmc/pmcdoc/tagging-guidelines/article/style.html
- NIHMS Manuscripts: https://www.ncbi.nlm.nih.gov/pmc/pmcdoc/tagging-guidelines/manuscript/style.html
- Bookshelf: https://www.ncbi.nlm.nih.gov/pmc/pmcdoc/tagging-guidelines/book/style.html
In the download package:
Files
The main file is nlm-stylechecker.xsl, and it xsl:include(s):
- stylecheck-match-templates.xsl
- stylecheck-named-tests.xsl
- stylecheck-helper-templates.xsl
Usage params
Identify the style to check against using the stylesheet-level parameter style=(manuscript|book|article). Check the documentation of your XSL processor on how to pass in a stylesheet-level parameter at runtime.
StyleChecker Parameters:
- manuscript - nihms manuscript style
- book - book content in PMC
- article - published articles (Default)
HTML report maker
style-reporter.xsl (included in the distribution) takes the output of nlm-stylechecker.xsl and makes an HTML Error/Warning report. The report shows:
- Name and path of the file being tested
- Root element of the file
- Rules that the file is being checked against (article, manuscript, book)
- Version of the Stylechecker
- A summary of the total warnings and errors
- Details of unique errors that link to the problem spot in the article below
- A copy of the article with the error/warning messages in place
- Some errors/warning link back to the proper place in the appropriate tagging guidelines (based on the stylesheet-level style parameter set when the transform was called)
To run the report maker:
- Run the article through nlm-stylechecker.xsl. This will create a new document with a root element of
<ERR>
which will contain a copy of the original file, with any Errors or Warnings in<error>
or<warning>
elements, placed in the article code. - Run the output of the first conversion through style-reporter.xsl to get an HTML report.
Tagging Guidelines Email List
As you may be aware, both the Tagging Guidelines and StyleChecker are updated quarterly, in an effort to make the PMC archive more robust, improve the quality of the XML submitted, and ensure stability for future retrieval. PubMed Central announces these periodic changes through our pmc-tagging-guidelines email list. To subscribe, please visit: https://www.ncbi.nlm.nih.gov/mailman/listinfo/pmc-tagging-guidelines.
Please send any questions or comments to PubMed Central pmc@ncbi.nlm.nih.gov