NLM StyleChecker v4.3.4

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.

On November 21, 2008, NLM released version 3.0 of the NLM Journal
TagSuite including version 3.0 of the Journal Publishing DTD. This
release was the first non-backward compatible release of the DTD.
Differences between 3.0 and earlier versions have caused us to 
define some new tagging rules and for content being submitted to
PMC in version 3.0 of the Journal Publishing DTD. 

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 both DTD 3.0 style and the earlier
(2.3) style. The Tagging Guidelines are available here:
http://www.pubmedcentral.nih.gov/pmcdoc/tagging-guidelines/article/style.html
http://www.pubmedcentral.nih.gov/pmcdoc/tagging-guidelines/manuscript/style.html
http://www.pubmedcentral.nih.gov/pmcdoc/tagging-guidelines/book/style.html


Tagging Guidelines Email List
--------------------------------------------------------------------
As you may be aware, both the Tagging Guidelines and Style Checker are updated periodically,
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:
http://www.ncbi.nlm.nih.gov/mailman/listinfo/pmc-tagging-guidelines.


Files
---------------------------------------------------------------------
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)