NLM StyleChecker v3.4.1
Download
This 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). Generally
it is making the same comments on files that the old
article-validatator.xsl and ms-stylechecker.xsl made.
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. Wherever there are problems 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 C++ Xalan
in the PMC production area. It would be good to make sure you are
validating the files against the DTD at the first transform.
Files
---------------------------------------------------------------------
Currently the files are being delivered by request, but we intend to
have the transform available over http soon.
The main file is nlm-stylechecker.xsl
It xsl:include(s):
stylecheck-match-templates.xsl
stylecheck-named-tests.xsl
stylecheck-helper-templates.xsl
Usage params
---------------------------------------------------------------------
You identify the type of file you are checking with a stylesheet-
level parameter.
style - this parameter describes the style that you wish to test
your file against. If no style parameter is declared, the
stylechecker will use 'article'. Currently, the values are:
manuscript - for nihms manuscript style
book - for book content in PMC
article - for published articles (this is the default)
Check the documentation of your XSL processor for how to pass in a
stylesheet-level parameter.
HTML report maker
---------------------------------------------------------------------
I've also updated the style-reporter.xsl (included in the
distribution).
This transform takes the output of nlm-stylechecker.xsl and makes
an HTML Error/Warning report.
The report shows
1. the name and path of the file being tested
2. the root element of the file
3. the rules that the file is being checked against (article,
manuscript, book)
4. the version of the Stylechecker
5. A summary of the total warnings and errors
6. Details of unique errors that link to the problem spot in the
article below
7. A copy of the article with the error/warning messages in place
8. 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)
The steps are pretty simple:
1. 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>/
<warning> elements placed in the article.
2. Run the output of the first conversion through style-reporter.xsl
to get an html report. This report will be a little different
that the one you get through the online tool, but it should give
you the same information.
It should be pretty straightforward to build a process to run these
stylesheets across a batch of articles. You could get fancy and check
for any <error> or <warning> elements after the first step. If there
are none, you can report the article as clean and not create the report.
Please send any questions or comments to Jeff Beck
(beck@ncbi.nlm.nih.gov)