<div></div><pre>2009-07-16,"Stefan Behnel" <stefan_ml@behnel.de>
>
>qhlonline wrote:
>> Hi, all I am parsing html files with lxml target parser, now I wan't to
>> know when I have reached some HTML tag, how can I know the position of
>> the HTML document I am parsing?
>
>These are two different requirements. Do you really need the line/character
>information here? Isn't the structural position enough?
>
>
>> Is there any callbacks in target parser
>> who can tell me the total stream length I have parsed?
>
>Not that I know of. Same as in ElementTree, I'd say.
>
>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>