I hope the utility of line numbers for XML elements is non-controversial.
(It would be nice to also include support for the xmlParserOption XML_PARSE_BIG_LINES, but this hasn't made its way to my distro's libxml2 package yet...)
Expose line numbers when parsing from string
@polotek any feedback? looks fine to me.
@jmandel The way forward is to include libxml2 sources with this module. Eventually I will get back to that. Then you won't need to rely on whatever your distro has packaged.
This looks fine. Thanks @jmandel. Do you mind sharing your use case with us? We're always curious what prompts these additions to the api.
On an unrelated note, I hate how much boilerplate it takes just to expose a method. Could probably work up a macro for these simple cases. But who has the time for that crap? :)
The use case is:
It's a tool for "scoring" clinical summary documents, determining how well they adhere to a set of best practices. The idea is to give the developers producing these documents good feedback about how to fix them. And being able to include line numbers in the error reports is obviously helpful.