<serious egg on my face> I added xmlTextReaderGetLocator a few months ago and forgot about it! I had made other changes and abandoned them with cvs update -C but this change stuck for some reason (probably because I was using it). I thought I was dealing with a clean cvs checkout, but obviously I'm not. So, perhaps my original question was more accurate: How does one *correctly* get line number information from the xmlTextReader interface? In CVS there is only one way to obtain an xmlTextReaderLocatorPtr and that is via the error callback. I added xmlTextReaderGetLocator to allow me to get the locator in non-error situations. Suppose I wanted to print the correct line number for every start tag (or end tag) that is encountered during xmlTextReader parsing? How should I do it? If you want to try the test program, you'll need the patch that is attached. It provides the declaration and definition of xmlTextReaderGetLocator. The patch was generated with cvs diff -Nacp. In case you're concerned, this patch constitutes the entire local changes I've made to libxml2. Everything else is as it was in CVS a few days ago. Sorry for the confusion, life's been hectic here the last few months. Reid. On Mon, 2004-02-23 at 03:07, Daniel Veillard wrote:
On Sun, Feb 22, 2004 at 11:17:21AM -0800, Reid Spencer wrote:The problem has been submitted as bug 135149. It includes a test program and data to show the problem. On Sun, 2004-02-22 at 04:31, Daniel Veillard wrote:On Sat, Feb 21, 2004 at 07:37:05AM -0800, Reid Spencer wrote:Hi, Since my last post ( see below ), I have discovered that I don't get accurate line numbers from xmlTextReaderGetLocator because my entire document is getting read ahead so that RelaxNG validation can occur. IfI really don't understand. Got your code, it uses xmlTextReaderGetLocator() but that function is not defined anywhere in the library nor in the headers. trying to run your binary executable also lead to a missing symbol too. paphio:~/XML/tmp/bug_135149 -> make ./lntest XPL.rng OneOfEach.xpl Depth Type Line Name/Value ./lntest: relocation error: ./lntest: undefined symbol: xmlTextReaderGetLocator make: *** [with_bug] Error 127 paphio:~/XML/tmp/bug_135149 -> What library did you link again ? Did you applied patches locally ? I can't understand what's happening. You indicate in the bug report compiling against CVS head but clearly this does not compile against it. Either I'm very tired or there is something else really weird on your side... Daniel
_______________________ Reid Spencer President & CTO eXtensible Systems, Inc. rspencer x10sys com
Attachment:
get_locator_patch.txt
Description: Text Data
Attachment:
signature.asc
Description: This is a digitally signed message part