[XML-SIG] Question about lxml and RELAX NG

Terry Jones terry at jon.es
Sat Apr 28 15:09:59 CEST 2007


I'm trying to validate some XML, and I'd like to use RELAX NG. Looking
around it seems that lxml may be the best way to go about this in Python.

Is that a good choice? Other possibilities seem to be minixsv and XVIF, but
these look less attractive (that's an uninformed quick impression - I'd be
happy to be told I'm wrong).

Although the documentation for using lxml is very simple and clear, I don't
see an explanation of what parts of RELAX NG are supported. I get an error
telling me my specification is not RELAX NG when I try to use a top-level
<grammar> element and also when I have two elements that refer to each
other using <externalRef name="..."/> (and IIRC also when I try to use
<define>).

Is there a description somewhere of what parts of RELAX NG are supported by
lxml?  I can provide detail of what I'm doing in case <grammar> etc.,
actually are supported.

If anyone has suggestions about better approaches to validating XML in
python, please let me know. I've not done this before and so might be
making bad/uninformed choices. The situation of python vis a vis XML
validation seems a bit unclear, based on what I've tracked down via google.

Thanks for any help,
Terry Jones


More information about the XML-SIG mailing list