lib/csl/schema.rb in csl-1.0.1 vs lib/csl/schema.rb in csl-1.0.2

- old
+ new

@@ -108,11 +108,16 @@ @file = File.expand_path('../../../vendor/schema/csl.rng', __FILE__) @validators = { :nokogiri => lambda { |schema, style| - schema.validate(Nokogiri::XML(style)).map { |e| [e.line, e.message] } + begin + schema.validate(Nokogiri::XML(style, nil, nil, Nokogiri::XML::ParseOptions::PEDANTIC)). + map { |e| [e.line, e.message] } + rescue + [[0, $!.message]] + end }, :default => lambda { |schema, style| raise ValidationError, "please `gem install nokogiri' for validation support" } @@ -215,6 +220,6 @@ attr_reader :validators, :validator, :schema end end -end \ No newline at end of file +end