[yunqa.de] Re: DIXml V1.0 Trial: XmlNodePtr and LineNo - what is the purpose?

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Mon, 07 Jul 2008 15:14:29 +0200

Hello Adam Russell,

>your comment "which can retrieves line numbers for some node types for
>which they are not recorded (from parent nodes, for example)" implies
>that there is some other place where the line numbers are recorded.

The bottom line is that the xmlNode.LineNo field is not indended to be used 
directly, but xmlGetLineNo() should be used instead.

>can you pls provide a bit more information and maybe a simple example?

When answering your question, I extended the DIXml_Node_Tree demo and noticed 
that xmlGetLineNo() only returns 0 (zero) for nodes of XML_TEXT_NODE type. 
Maybe this is what you meant by "a discrete number of values".

It turned out that this is a bug in the underlying libxml. I am in contact with 
the libxml developers and will update DIXml as soon as the fix is confirmed.

Please find attached the extended DIXml_Node_Tree demo which shows the 
elements' the line numbers for the current node selection in the status bar.

Ralf 

Other related posts: