<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<STYLE type="text/css"><!--
BODY {
  margin: 5px 5px 5px 5px;
  background-color: #FFFFFF;
}
/*----------Text Styles----------*/
HR { color: #000000}
BODY, TABLE /* Normal text */
{
 font-size: 9pt;
 font-family: 'Courier New';
 font-style: normal;
 font-weight: normal;
 color: #000000;
 text-decoration: none;
}
SPAN.RVTS1 /* Heading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #0000FF;
}
SPAN.RVTS2 /* Subheading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #000080;
}
SPAN.RVTS3 /* Keywords */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-style: italic;
 color: #800000;
}
A.RVTS4, SPAN.RVTS4 /* Jump 1 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
A.RVTS5, SPAN.RVTS5 /* Jump 2 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
A.RVTS6, SPAN.RVTS6
{
 color: #0000FF;
 text-decoration: underline;
}
A.RVTS7, SPAN.RVTS7
{
 color: #0000FF;
 text-decoration: underline;
}
SPAN.RVTS8
{
 font-weight: bold;
}
/*----------Para Styles----------*/
P,UL,OL /* Paragraph Style */
{
 text-align: left;
 text-indent: 0px;
 padding: 0px 0px 0px 0px;
 margin: 0px 0px 0px 0px;
}
.RVPS1 /* Centered */
{
 text-align: center;
 white-space: normal;
}

--></STYLE>
</HEAD>
<BODY>

<P>Hello</P>
<P><BR></P>
<P>I'm just getting into the world Python/lxml.</P>
<P><BR></P>
<P>I did a little python module to valid an XML document against relaxNG rules with lxml.</P>
<P><BR></P>
<P>My purpose is to be abble to deliver a maximum of details when a validation error occur.</P>
<P><BR></P>
<P>I've found some informations here&nbsp;<A class=RVTS7 href="http://codespeak.net/lxml/dev/api.html#error-handling-on-exceptions">http://codespeak.net/lxml/dev/api.html#error-handling-on-exceptions</A></P>
<P><BR></P>
<P>Where Can I found the documentation API for&nbsp;<SPAN class=RVTS8>error_log</SPAN>&nbsp;?</P>
<P><BR></P>
<P>I've found a bit by chance how to render the line number error but I would like for example to be abble to give to the users the offset (or position in line) where the error occur.</P>
<P><BR></P>
<P>Here is some part of my developpement code &nbsp;:</P>
<P><BR></P>
<P>&nbsp; &nbsp; def _result(self, docXml):</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; if self._relaxngEngine.validate(docXml):</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; resultValidation = "Document is valid"</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; else:</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log = self._relaxngEngine.error_log[0]</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #log = e.error_log.filter_levels(etree.ErrorLevels.FATAL)</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #self._relaxngEngine.assertValid(docXml)</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #resultValidation = log.last_error</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; resultValidation = log.domain_name, log.type_name, log.filename, log.line</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</P>
<P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #resultValidation = self._relaxngEngine.error_log[0].col #(this doesn't work)</P>
<P><BR></P>
<P><BR></P>
<P>My main problem is that where is the complete documentation ?</P>
<P><BR></P>
<P>Thank you for help !!</P>
<P><BR></P>
<P><BR></P>
<P>Eric</P>
<P><BR></P>
<P>-----------------------------------</P>
<P>*&nbsp;&nbsp;Eric&nbsp;Garin&nbsp;-&nbsp;<A class=RVTS6 href="mailto:eric@detede.com">eric@detede.com</A>&nbsp;&nbsp;&nbsp;*</P>
<P>*&nbsp;&nbsp;DeTeDe&nbsp;-&nbsp;XML&nbsp;Editorial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</P>
<P>*&nbsp;&nbsp;C/&nbsp;Arag&#243;&nbsp;410&nbsp;Ent-6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</P>
<P>*&nbsp;&nbsp;08013&nbsp;Barcelona&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</P>
<P>*&nbsp;&nbsp;Tel.&nbsp;:&nbsp;(+34).93.246.27.67&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</P>
<P>*&nbsp;&nbsp;<A class=RVTS6 href="http://www.detede.com">www.detede.com</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</P>
<P>-----------------------------------</P>

</BODY></HTML>