[xml] Inspecting a RelaxNG schema

Hi all,
apologies if I missed any relevant FAQ or documentation entries. I'm using the Python bindings (specifically, the RelaxNG module API) to parse a RelaxNG schema. What I'm doing is:

>>> from libxmlmods import libxml2mod
>>> ctxt = libxml2mod.xmlRelaxNGNewParserCtxt('foo.rng')
>>> schema = libxml2mod.xmlRelaxNGParse(ctxt)

which, I guess, is a fairly direct translation of the corresponding C code.

By the end of the last instruction, the RelaxNG module has made most of the work I'm interested in at the time. In particular, and if I'm not mistaken, it descended into any documents referenced by <include> nodes in order to build the full schema (well, it wanted the referenced files to be there, so I assumed it did read them.) The problem is, the resulting xmlRelaxNGPtr is returned to Python as a very much opaque PyCObject pointer.

My question is, is there any exported function in the module which will allow me to inspect the created schema? Can it be converted to some less opaque structure? Or should I resort to coding in C <shudder>?

Thanks in advance,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]