[xml] [Patch] Add column storage for xmlNode



Hi,

I'd like to show you a patch which adds the functionality to store and retrieve the columns of xml nodes.

As I said in a previous email[1] me, and probably other people are in need of this to highlight a certain text area in an xml document.

For example, if I have an xml document

    <document><node1/></document>

and an xpath expression

    //node1

I'd like to be able to highlight the corresponding part of the document. Without this patch, it was impossible, because the parser did not save the column information.


I applied the following changes in this patch:

- added a new member to _xmlNode called column. I know that this breaks ABI compability, but I think this is an important feature and needs to be added soon. - increased the type size of _xmlNode->line from (unsigned short) to (unsigned int). This is what the idea behind "XML_PARSE_BIG_LINES" is. ( can you tell me why it has been an unsigned short in the first place ? ) - added a function xmlGetColumnNo() which is the counterpart to xmlGetLineNo()
- wrote a unittest for xmlGetColumnNo()


I hope for any feedback and a soon integration.

Thanks,
Daniel Nagy

[1] https://mail.gnome.org/archives/xml/2012-February/msg00045.html

Attachment: 0001-add-column-storage.patch
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]