<div></div><pre>2009-07-16,"Stefan Behnel" &lt;stefan_ml@behnel.de&gt; 
&gt;
&gt;qhlonline wrote:
&gt;&gt; Hi, all I am parsing html files with lxml target parser, now I wan't to
&gt;&gt; know when I have reached some HTML tag, how can I know the position of
&gt;&gt; the HTML document I am parsing?
&gt;
&gt;These are two different requirements. Do you really need the line/character
&gt;information here? Isn't the structural position enough?
&gt;
&gt;
&gt;&gt; Is there any callbacks in target parser
&gt;&gt; who can tell me the total stream length I have parsed?
&gt;
&gt;Not that I know of. Same as in ElementTree, I'd say.
&gt;
&gt;Stefan
<br>If there are some way for me to get the parsing context, and if I can access this structure directly, may be this problem can get solved.  In libxml2 there is a defination of "struct _xmlParserCtxt". This structure have a member "long nbChars; " , It is just the "number of xmlChar processed" .    <br></pre><br><!-- footer --><br><span title="neteasefooter"/><hr/>
<a href="http://count.mail.163.com/redirect/footer.htm?f=http://gouwu.youdao.com">200万种商品,最低价格,疯狂诱惑你</a>
</span>