Copyright 2009, XBRL International Inc.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

This directory contains the Schematron-based validation code
for enforcing each of the validation rules defined in the Inline XBRL
specification.

To ensure that a given document is a valid Inline XBRL document,
first validate it against the W3C XML schema provided in the "schema"
directory. Then validate it against the Schematron schema provided
in this directory.


HOW TO RUN THE VALIDATOR

This validator requires an XSLT 2.0 processor, such as Saxon 9. To
run the validator, apply the validator.xsl stylesheet to your input
document. The output is an XML-based report of all the constraints
that were checked, as well as information about which constraints were
violated, if any.

Here's an example of how to apply validator.xsl to your input document.

  saxon YourInlineXBRL.xhtml validator.xsl > validation-results.xml

Query the resulting file ("validation-results.xml" in the above example)
to see if there are any validation errors and what they were. Validation
errors are signified by the presence of an <svrl:failed-assert> element.


IMPLEMENTATION NOTES

validator.xsl -
  This is the compiled validation code. It is automatically generated (using
  the generateValidator.sh script).  Do *not* edit this file directly. Instead,
  to update this file, make changes to the Schematron source (inlineXBRL.sch),
  and then re-run generateValidator.sh.

inlineXBRL.sch -
  This Schematron schema is the primary source code for the Inline XBRL
  validator. If you need to make changes to the validator rules, this is
  the file to edit.

iso-schematron (directory) -
  This directory contains the ISO Schematron distribution which is used by
  generateValidator.sh to generate validator.xsl.

fixupValidator.xsl -
  This stylesheet makes some minor changes to the compiled stylesheet so
  that it can be imported into other XSLT code without name collisions.
  This modification helps with implementing an XSLT-based validating processor
  that reuses validator.xsl for input checking.

generateValidator.sh -
  This simple script re-generates (or "compiles") validator.xsl from the
  inlineXBRL.sch source, using the iso-schematron implementation included
  in this directory. If you need to make changes to inlineXBRL.sch, be sure
  to also run this script so that your changes will be reflected in
  the compiled rule-checker (validator.xsl).

inlinexbrl-1_0_transformation.xsd -
  This XSD stylesheet (copied over from the Inline XBRL schema files) contains
  all the regular expressions that constrain the values for the various
  "ixt" format values, as well as human-readable descriptions of those constraints.
  The Schematron rules (in inlineXBRL.sch) use these for validating the values
  of fields having a particular "format" specification, such as "dateslashus".
