With libxml2, we can use xmlGetLineNo
to get the line number in which a node appears in the source XML file.
But how to get character positions of a given element and a given attribute? I need both the start
and end
positions in the source xml file for both a node and an attribute.
Thanks!
You can use the SAX2 interface which has the xmlSAX2GetColumnNumber method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With