Versions Compared

Key

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

DIY Schema Validation for Workmanlike ONIX

...

https://github.com/Microsoft/XmlNotepad

The installer for Windows can be found on the Wiki tab.

MAC

There are fewer free choice for Macs, but there is a good one that only costs $1.99 at the Mac App Store – XML Nanny:

...

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.

...