Hi, Tim Arnold wrote: > Hi, this is a newbie question I'm sure. I'm trying to validate an > example straight out of the docbook 5 documentation (example given > on the 'inlineequation' page). As it stands, the file doesn't pass > as valid. > > The code: > ======================================= > from lxml import etree > import os > # RNGDIR = 'path to docbook.rng' > # XMLDIR = 'path to the xml file' > relaxng_doc = etree.parse(os.path.join(RNGDIR,'docbook.rng')) > relaxng = etree.RelaxNG(relaxng_doc) > > doc = etree.parse(os.path.join(XMLDIR,'myfile.xml')) > print relaxng.validate(doc)
What does the validator tell you why it's not considered valid? Note that there's a property "error_log" which returns a sequence of messages that were collected during validation. http://codespeak.net/lxml/validation.html#relaxng Stefan _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig