Sha256: 5f5bb4d619e1900159061c9c8060333428e5b8fb2410bdaeb94765a26aebdb23

Contents?: true

Size: 528 Bytes

Versions: 5

Compression:

Stored size: 528 Bytes

Contents

module LibXMLJRuby
  module XML
    class Dtd
      def initialize(schema)
        @schema = schema
      end
      
      def validate(doc)
        validator.validate(doc)
      end
      
      def schema_factory
        SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema")
      end
      
      def schema
        schema = schema_factory.newSchema(StreamSource.new(ByteArrayInputStream.new(@schema.to_java_bytes)))        
      end
      
      def validator
        schema.newValidator
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 4 rubygems

Version Path
libxml-jruby-modified-1.0.2-jruby lib/libxml-jruby/xml/dtd.rb
libxml-jruby-modified-1.0.1-jruby lib/libxml-jruby/xml/dtd.rb
libxml-fixed-jruby-1.0.0-jruby lib/libxml-jruby/xml/dtd.rb
libxml-jruby-fixed-1.0.0-jruby lib/libxml-jruby/xml/dtd.rb
libxml-jruby-1.0.0 lib/libxml-jruby/xml/dtd.rb