Re: [xml] [Patch] Add column storage for xmlNode



On Sun, Aug 26, 2012 at 09:21:03PM +0200, Daniel Nagy wrote:
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.
[...]
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index 1f11fd9..987f16a 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -257,6 +257,7 @@ struct _xmlParserCtxt {
 
     int                loadsubset;    /* should the external subset be loaded */
     int                linenumbers;   /* set line number in element content */
+    int                columnnumbers; /* set column number in element content */
     void              *catalogs;      /* document's own catalog */
     int                recovery;      /* run in recovery mode */
     int                progressive;   /* is this a progressive parsing */

 Adding this at the end of the structure would be possible,

diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index 68f92f9..7e18a01 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -502,7 +502,8 @@ struct _xmlNode {
     struct _xmlAttr *properties;/* properties list */
     xmlNs           *nsDef;     /* namespace definitions on this node */
     void            *psvi;   /* for type/PSVI informations */
-    unsigned short   line;   /* line number */
+    unsigned int    line;     /* line number */
+    unsigned int    column;   /* column index */
     unsigned short   extra;  /* extra data for XPath/XSLT */
 };

  I said no previously to extending _xmlNode sorry! I do not want
to do this, ABI breakage, that data structure is being allocated
sometimes by user code, we can't change it. If I were to release
libxml3 and break ABI I might do this, but now I can't do this in
libxml2.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



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