[XML-SIG] RELAX NG and Python

Jonathan Cooper python-xml at jonc.me.uk
Thu Nov 3 12:51:17 CET 2005


I'm having some difficulties validating using RELAX NG in Python.  I've
been writing a schema for CellML files (www.cellml.org; current schema is
at http://jonc.me.uk/stuff/cellml1.0.rng), and I can validate various
example documents using jing.  The python tools I've come across have not
been as successful.


4Suite appears to have problems parsing constructs like:
foreign-elements =
  element * - (cellml:* | rdf:* | mathml:*) { foreign-nodes }*

It throws an RngSchemaInvalidException: Unamed Element


Using lxml results in an error value of XML_RELAXNG_ERR_MEMORY, which
isn't very helpful.


Using the libxml2 module directly says that the file is invalid (curious,
since jing says it's valid when using the same schema, and it looks fine
to me).  Trying to find out which element 'fails' is tricky, since
calling LineNumber() on the xmlTextReaderLocator object passed to my
error handler causes a segfault :(


Any suggestions for what to try next?

TIA,
 Jonathan.

-- 
Jonathan Cooper      MSN: msn at jonc.me.uk      www: jonc.me.uk/

In democracy your vote counts. In feudalism your count votes.


More information about the XML-SIG mailing list