lib/csl/schema.rb in csl-1.0.0.pre2 vs lib/csl/schema.rb in csl-1.0.0.pre3
- old
+ new
@@ -99,13 +99,18 @@
raise ValidationError, "please `gem install nokogiri' for validation support"
}
}
begin
- require 'nokogiri'
- @validator = @validators[:nokogiri]
- @schema = Nokogiri::XML::RelaxNG(File.open(@file))
+ # TODO enable java validator when nokogiri issue is fixed
+ if RUBY_PLATFORM =~ /java/i
+ @validator = @validators[:default]
+ else
+ require 'nokogiri'
+ @validator = @validators[:nokogiri]
+ @schema = Nokogiri::XML::RelaxNG(File.open(@file, 'r:UTF-8'))
+ end
rescue LoadError
@validator = @validators[:default]
end
class << self
@@ -128,10 +133,10 @@
# @example
# CSL::Schema.validate(CSL::Style.load(:apa))
#
# CSL::Schema.validate('my-styles/style.csl')
# CSL::Schema.validate('my-styles/*.csl')
- # CSL::Schema.validate('http://www.example.org/style.csl')
+ # CSL::Schema.validate('http://www.zotero.org/styles/vancouver')
#
# @param style [Node,String,IO,Array] the style (or a list of styles)
# to validate.
#
# @raise [ArgumentError] if the passed-in argument is not a Style or
\ No newline at end of file