Hi,

I'm using libxml-ruby 1.1.3, with ruby 1.9.1 on OSX.
Reading stuff works nicely, but when it comes to schema validation I'm
having the following issue.

I have one XSD you can find here : 
http://pastie.org/private/ibjtrwso8gckh1lz9sdda
The document I try to validate is :

---
<?xml version="1.0" encoding="utf-8"?>

<document>
  <emph>World</emph>
</document>
---

My problem is when I try to validate it, I'm punched back with :
"Error: No declaration for element emph at /Users/jh/Sources/(...)/
2.xml:4"

At first I thought it was a mistake I could have made in the schema,
but after trying to validate it with other tools, it seems my schema
is correct.

Moreover, I can't validate the w3school example you can find here :
http://www.w3schools.com/Schema/schema_example.asp , I get the
following error ( using the named types approach ) : http://pastie.org/425227

Here is the ruby code I use to validate :

schema_document = XML::Document.file(path)
@schema = XML::Schema.document(schema_document)

XML::Document.file(document_path(document)).validate(@schema)

Thanks,

jhc_
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to