2008-08-31 | Paul Boddie | file changeset files shortlog | Added Relax-NG validation support. Added DOMConfiguration support to the _Document class, adding an error handler (DOMErrorHandler, new in libxml2dom.errors) to deal with validation errors and warnings. Added missing parser context disposal. Switched DOMException usage to specific xml.dom exception usage. Updated release notes. |
paul@339 | 1 | #!/usr/bin/env python |
paul@339 | 2 | |
paul@339 | 3 | import libxml2dom |
paul@339 | 4 | |
paul@339 | 5 | schema = libxml2dom.parse("tests/test_valid_relaxng.xml") |
paul@339 | 6 | d = libxml2dom.parse("tests/test_valid.xml") |
paul@339 | 7 | print d.validate(schema) |
paul@339 | 8 | print d.validateDocument(schema) |
paul@339 | 9 | print d.getParameter("error-handler") |
paul@339 | 10 | |
paul@339 | 11 | schema = libxml2dom.parse("tests/test_invalid_relaxng.xml") |
paul@339 | 12 | d = libxml2dom.parse("tests/test_invalid.xml") |
paul@339 | 13 | print d.validate(schema) |
paul@339 | 14 | print d.validateDocument(schema) |
paul@339 | 15 | print d.getParameter("error-handler") |
paul@339 | 16 | |
paul@339 | 17 | # vim: tabstop=4 expandtab shiftwidth=4 |