Uninitialized constant LibXMLJRuby::XML::Schema

Hello,
I’m trying to validate a xml File against a ‘*.xsd’ Schema-File.

  • I have the libxml-jruby Gem installed.
  • I’m using JRUBY 1.4.0

My code looks like this:


require ‘xml’

document = XML::Document.file(temp_file.path)
schema = XML::Schema.document(xsd_file_name)

I get this error:
uninitialized constant LibXMLJRuby::XML::Schema

Does anybody know how to do it right?

On Wed, May 5, 2010 at 1:19 AM, Michael Schröder [email protected]
wrote:

document = XML::Document.file(temp_file.path)
schema = XML::Schema.document(xsd_file_name)

Try

schema = XML::Schema.document(document)


Enjoy global warming while it lasts.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Actually I wan’t to validate the document against a given schema, like
this.


require ‘xml’

document = XML::Document.file(temp_file.path)
schema = XML::Schema.document(xsd_file_name)
document.validate_schema(schema)

The Problem is that, obviously Schema Class is not a Member of
LibXMLJruby::XML,
although the Document Class is.

In the meantime we found a workaround by using Java calls, but it’s kind
of wasting resources, also we had sporadic Java Heap Size problems.