Re: [xml] xmlGetLineNo() always returns 0 for XML_TEXT_NODE



On Mon, Jul 07, 2008 at 12:23:34PM +0200, Ralf Junker wrote:
Hello Daniel and others,

I observed that xmlGetLineNo() returns 0 only for XML_TEXT_NODE nodes.

Is this the correct / intentional behaviour or am I seeing wrong results?

Ralf

PS: I did call xmlLineNumbersDefault(1); before parsing and xmlGetLineNo works correctly for other node 
types.

  Hum, we should really not rely on the global variables anymore for this.
This may depend on the API used, i.e. whether you're on SAX1 or SAX2 underneath.
It seems xmlSAX2TextNode() forgets to set the line, can you check the
enclosed patch fixes it for you ?

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

Attachment: text_line.patch
Description: Text document



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