<div> </div><div> </div><div> </div><div> </div> Re:Re: [lxml-dev] About the position of html parsing by HTML Target
        parser<br><div><br><br></div><pre>2009-07-17,"Nicholas Dudfield" <<a href="mailto:ndudfield@gmail.com">ndudfield@gmail.com</a>>
>Wow, someone else with this requirement. I was meaning to post to the
>list about this. I'm using lxml to implement a XPath / CSS selection
>plugin for a python extensible editor. I'd like to have a mapping of
>view buffer regions to xml nodes. The workaround I used to get the
>exact character position was to use the feed interface, a character at
>a time and manually monitor bytestream position. It's fairly slow
>though. I'd like to implement this in CYthon or use whatever
>underlying facility there is to speed it up.
>
Thank you for your suggestion. I have another idea that I can cumulate total characters of tags and text parsed when I encounter an element, that will mean I have to set a counter to add characters got by startElement function and data function of target parser。This is not an accurate result although. <br> But the key problem is that we need high parsing speed too. I mean we should get the position value during the parsing process. The libxml2's ParsingContext does provide a value of current parsing position. Now I wan't to read it in lxml. So I think I have to define a callback function in libxml2 to access to the value and then alter part of lxml pxi source to receive the value in target parser. I don't know whether this will do, but I am trying. Thank you for your suggestion again! <br>>You can see some screen casts at this forum thread which should make
>it more obvious what I mean re: css / xpath document selections:
>http://www.sublimetext.com/forum/viewtopic.php?f=5&t=547
>
>Cheers.
>_______________________________________________
>lxml-dev mailing list
><a href="mailto:lxml-dev@codespeak.net">lxml-dev@codespeak.net</a>
>http://codespeak.net/mailman/listinfo/lxml-dev
</pre><br><br><span title="neteasefooter"><hr>
<a href="http://count.mail.163.com/redirect/footer.htm?f=http://gouwu.youdao.com"><br></a>
</span><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>