> -----Original Message----- > From: hamil...@xmlpress.net [mailto:hamil...@xmlpress.net] > Sent: Monday, March 28, 2011 1:38 PM > To: Tim Arnold > Cc: docbook@lists.oasis-open.org > Subject: Re: [docbook] v5 relaxng question > > Tim, > > What tool are you validating with? > > I'm able to validate chapters using jing without a problem, and I also > edit them in emacs/nxml more without any error messages. > > Best Regards, > Richard Hamilton > On Mar 28, 2011, at 8:50 AM, Tim Arnold wrote: > > > hi, > > My documents are usually standalone chapters. > > I get an error when I validate against the V5 relaxng that says > > "Expecting element set, got chapter, line 2" > > > > From the spec, it appears that a standalone file has to start with a > set, book, section, etc, but not a chapter: > > http://www.docbook.org/xml/5.0/rng/docbookxi.rnc > > > > Is that intentional? > > I eventually put the chapters together as a book, but I like to validate > the chapters sequentially. > > > > thanks, > > --Tim Arnold > > > > > > ------- > XML Press > XML for Technical Communicators > http://xmlpress.net > hamil...@xmlpress.net > (970) 231-3624 >
Thanks Richard, Nic, I didn't understand that db.components would include chapters, but I guess the real issue is that I'm using the Python lxml module (which uses libxml2/libxslt) to do the validation. My test code: --------------------------- from lxml import etree tree = etree.parse('dbtest.xml') relaxng = etree.RelaxNG(file='/path_to/DocBook/V5.0/rng/docbookxi.rng') relaxng.assertValid(tree) --------------------------- results in: File "lxml.etree.pyx", line 3006, in lxml.etree._Validator.assertValid (src/lxml/lxml.etree.c:125415) lxml.etree.DocumentInvalid: Expecting element set, got chapter, line 2. the dbtest.xml starts out with this line: --------------------------- <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0"> --------------------------- >From your info, it sounds like there is a bug somewhere further up the line >starting at lxml. I'll write a message to that mailing list. Thanks for pointing me in the right direction! --Tim --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-h...@lists.oasis-open.org