I use LibXML in Perl, which store the start line number of each node, but how i can get the last one?
I tried get last line number through..
- ..counting newlines in innerhtml of the node, but LibXML return the innerhtml in different formatting than original, so that the line number differ.
- ..node->getLastChild->line_number, but also havin no success.
Any Idea?
If
line_number
returned the first line of a node as you say, all you'd need isBut it doesn't. What
line_number
returns is actually closer the number of the last line of the node. For that, we could simply look at the previous sibling's line number.But while that's what it returns for non-element nodes, it returns the last line number of the start tag (rather than of the element as a whole) for elements. That's completely useless.
Sorry, no can do!