def validate
      errors = []
      schema_path = File.expand_path("../../../vendor/AppleDictionarySchema.rng", __FILE__)

      schema = Nokogiri::XML::RelaxNG(File.open(schema_path))
      schema.validate(Nokogiri::XML(self.to_xml)).each do |error|
        errors << error
      end

      if errors.size > 0
        return errors
      else
        return true
      end
    end
def validate
      errors = []
      schema_path = File.expand_path("../../../vendor/AppleDictionarySchema.rng", __FILE__)

      schema = Nokogiri::XML::RelaxNG(File.open(schema_path))
      schema.validate(Nokogiri::XML(self.to_xml)).each do |error|
        errors << error
      end

      if errors.size > 0
        return errors
      else
        return true
      end
    end
Validate Dictionary xml with Apple's RelaxNG schema.

 Returns true if xml is valid.
 Returns List of Nokogiri::XML::SyntaxError objects if xml is not valid.