Class | Nokogiri::XML::Schema |
In: |
lib/nokogiri/ffi/xml/schema.rb
lib/nokogiri/xml/schema.rb ext/nokogiri/html_document.c |
Parent: | Object |
Nokogiri::XML::Schema is used for validating XML against a schema (usually from an xsd file).
Validate an XML document against a Schema. Loop over the errors that are returned and print them out:
xsd = Nokogiri::XML::Schema(File.read(PO_SCHEMA_FILE)) doc = Nokogiri::XML(File.read(PO_XML_FILE)) xsd.validate(doc).each do |error| puts error.message end
The list of errors are Nokogiri::XML::SyntaxError objects.
errors | [RW] | Errors while parsing the schema file |
Validate thing against this schema. thing can be a Nokogiri::XML::Document object, or a filename. An Array of Nokogiri::XML::SyntaxError objects found while validating the thing is returned.