Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

DIY Schema Validation for Workmanlike ONIX

...

You'll find that this document is written primarily for ONIX 2.1 – which remains the main ONIX version used for print in North America, still, though the digital supply chain is using ONIX 3.0.  From the point of view of validation the information here applies equally – only the file names change.  And the  The two versions are very similar and if you're validating ONIX 3.0 and can't interpret what do based on this document let us know at the email at the bottom.  We hope to update this document to ONIX 3.0 centred soon.

There is one very important difference between ONIX 2.1 and ONIX 3.0:  EDItEUR has stopped supporting ONIX 2.1.   Within the published code lists from EDItEUR used in ONIX there are

  • code lists unique to ONIX 2.1 and code lists unique to ONIX 3.0.  They come in three general types:
    • code lists for ONIX 2.1 where a different code list exists for ONIX 3.0
      • Product Form / Product Form Detail are examples:  ONIX 2.1 uses Lists 7 and 78 and ONIX 3.0 uses Lists 150 and 175
    code lists unique to ONIX 2.1 and code lists unique to ONIX 3.0
    • In In most cases ONIX 3.0 has an equivalent list to any ONIX 2.1 but in some cases the 3.0 methods are very different – different and there's no direct equivalency.
      • Compare 2.1's PR.16 Links to 3.0's P.16 Links as an example.
    • ONIX 3.0 only lists – there are many 3.0 lists with no 2.1 equivalent because 3.0 supports new features unsupported in 2.1
  • code lists shared by both ONIX 2.1 and 3.0

It's the shared code lists that are most affected by EDItEUR dropping support.  The Schema for ONIX 2.1 and 3.0 share one file – file for Codelists – for the XSD version that's ONIX_BookProduct_CodeLists.xsd.   All development of 2.1 has stopped for several years (no additions to it's codes or changes to it's format) but a back door type of update has remained :  The in that the shared code lists continue to be updated for ONIX 3.0.  As well, the unique to ONIX 2.1 code lists remain remained in schema's codelist files.

That's changed:  As of Code List Issue 37 (April 2017) the ONIX 2.1 only code lists are removed from the schema file.  EDItEUR's board has determined that with Issue 37 that no new "shared" code can be considered to be part of ONIX 2.1.    ONIX 2.1 is now static and permanently should use the Codelists for Issue 36.  This doesn't really affect ONIX 2.1 – it's functionality and the ability of anyone to use remains.   This just recognizes what's been true for a while – it's not longer being developed.

For the purpose of this all that means is if you're doing an ONIX 2.1 validation that you shouldn't update your ONIX_BookProduct_CodeLists.xsd with an ONIX 3.0 version because the validation won't work.  It checks files against codes and codes will be missing. 

...

XML Nanny is excellent, simple software but some users have reported a line limit on XML Nanny where the software reports an error at line 65,535 when the actual error is many lines further down the file.  It appears that citation is accurate – an error exists – but the line reporting stops working.  If XML Nanny reports the file is fine, it is.  It's only if it reports an error after line 65,535 that this crops up.  On the assumption working solution to an issue is better than nothing and that you might have access to a PC, if you think you've encountered this issue and need a workaround try ONIX file splitter:

Free ONIXEdit Splitter

It's excellent software and reliably splits any size of ONIX file of either version, into same sized pieces which can be individually validated if you think you've run into this issue.

Linux and MAC

xmllint comes installed in most Linux versions and on many Macs as well.  It's a command line XML parser which means you'll need to write small scripts to do validations. I'm not going to illustrate any more than the below (and don't use this unless you're more comfortable using command line tools than me), but this example is intended for a Mac, with the username "Bob" with a folder called "schema" on his "Desktop", containing (in this case) the ONIX 2.1 reference schema "ONIX_BookProduct_Release2.1_reference.xsd",  The Desktop contains an ONIX file "TestOnix.xml" which has been set up for schema as noted below.  

Note that there are some instructions in the "Reference or Short Tag" section below on how to confirm the file location on a MAC – you have to be absolutely right in your location or it doesn't work. And you need to understand the difference between Reference or Short tags as well.  All that is discussed below in more detail.

This worked for me using Terminal:

Code Block
xmllint --schema /Users/Bob/Desktop/schema/ONIX_BookProduct_Release2.1_reference.xsd /Users/Bob/Desktop/TestOnix.xml

You can find a full listing of commands here:

Java

Java based programs should workon any system but are seldom free.  I'll illustrate oXygen as it's often recommended for working with ePub.  It's expensive but you can get it on a 30 day trial.  Any of the versions Editor / Developer / Author will work for validation.

...