The RELAX NG validator currently does not handle XML documents with an XML declaration, such as <?xml version="1.0" encoding="UTF-8"?>.
As a first step to address this issue, I suggest adding the following test case to test/test_validation_rng.rb. This test case checks that the validator can successfully validate an XML document with a declaration. I haven't yet developed an implementation solution, but this test will help ensure that we cover this scenario:
deftest_document_with_declarationrng=<<-XML<?xml version="1.0" encoding="UTF-8"?><grammar xmlns="http://relaxng.org/ns/structure/1.0"> <start> <element name="root"/> </start></grammar>XMLvalidator=REXML::Validation::RelaxNG.new(rng)source=<<-XML<?xml version="1.0" encoding="UTF-8"?><root/>XMLno_error(validator,source)end
The RELAX NG validator currently does not handle XML documents with an XML declaration, such as
<?xml version="1.0" encoding="UTF-8"?>.As a first step to address this issue, I suggest adding the following test case to
test/test_validation_rng.rb. This test case checks that the validator can successfully validate an XML document with a declaration. I haven't yet developed an implementation solution, but this test will help ensure that we cover this scenario: