Kataba (片刃) provides XML Schema Definition (XSD) mirroring and offline validation for Nokogiri
- Configuration to enable optional mirror list for XSD files
- Configuration to alter offline storage location
- Recursive XSD search to ensure total depth processing (i.e. XSD -> import -> etc.)
- All required XSD files are downloaded and renamed to the MD5 of their URI so they can be unique
- Flat folder structure - see http://ktulu.com.ar/blog/2011/06/26/resolving-validation-errors-using-nokogiri-and-schemas/
gem install kataba
Kataba.configuration.offline_storage = "/tmp/kataba"
Kataba.configuration.mirror_list = File.join(Rails.root, 'config', 'mirror.yml')
The fetch_schema method returns a Nokogiri::XML::Schema object
xsd = Kataba.fetch_schema("http://www.loc.gov/standards/mods/v3/mods-3-5.xsd")