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



Daniel Veillard wrote:

This may depend on the API used, i.e. whether you're on SAX1 or SAX2 underneath.

I am using xmlReadFile(), which is supposed to use SAX2 underneath (if I am not mistaken).

It seems xmlSAX2TextNode() forgets to set the line, can you check the
enclosed patch fixes it for you ?

Yes, the patch appears to work well. It makes xmlGetLineNo() return proper line numbers for XML_TEXT_NODE 
nodes where it returns just 0 (zero) without the patch.

Saying this, I did not run comprehensive tests for all other node types, but a quick glance revealed not 
further problems.

Many thanks for the quick response,

Ralf  




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