With libxml, how to get the character position of a given element or attribute in an XML source file?

With libxml2 we can use xmlGetLineNoto get the line number where node appears in the XML source file.

But how to get the symbol positions of a given element and a given attribute ? I need both start, and endpositions in the source XML file for both node and attribute.

Thank!

+5
source share
1 answer

You can use SAX2 interface that has a method xmlSAX2GetColumnNumber .

+2
source

All Articles