Re: [xml] newTextReader's GetParserLineNumber is too keen??



Nigel Tao wrote:
> Is this a bug or am I doing something wrong?  And if this is a bug,
> can I get some hints as to what parts of the code to look to patch?
>

I would say it's a case of the function description needing a little more elaboration, or a caveat:

From http://xmlsoft.org/html/libxml-xmlreader.html :
Function: xmlTextReaderGetParserLineNumber

int     xmlTextReaderGetParserLineNumber        (xmlTextReaderPtr reader)

Provide the line number of the current parsing point.
reader: the user data (XML reader context)
Returns:        an int or 0 if not available

Maybe add: "This information is only useful if you are debugging the parser."

When I attempted to use the function, I was trying to report a parsing error in such a way that a human being examining an XML file in a text editor like vi could go to the reported line number and figure out what it was that had offended the parser or the back end (like, a value out of range). I wound up reporting the enclosing tag instead. :-(

--
Bruce A. Johnson
Software Engineer
Blue Ridge Networks
(703) 633-7320 / ext. 233
Tuesday is the Wednesday of the rest of your life.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]