xmlreader get column number of current node
The streaming API of libxml2 provides the following functions to obtain the current parser line / column:
int xmlTextReaderGetParserColumnNumber (xmlTextReaderPtr reader) int xmlTextReaderGetParserLineNumber (xmlTextReaderPtr reader)
But the returned line/column number is the internal parser point, not the line of the current node. It is possible though to obtain the current node line number using:
xmlNodePtr curNode = xmlTextReaderCurrentNode(xmlTextReader_); lineNo_ = xmlGetLineNo(curNode);
but there is no function xmlGetColNo(xmlNodePtr).
I made a simple (not complete) proof of concept to create function "int xmlGetLineNo(xmlNodePtr node)" and update the node column at least when using the streaming API. See attached patch which is just a test and it is not the right approach for sure.
Could it be possible to create add xmlGetColNo function to libxml2 or provide a different approach to obtain the current node column number?patch-2.9.12