From 9716acfcc3a7dfbd3ee55fe55c28937eac2f1a57 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Wed, 20 Feb 2013 23:23:35 +0100 Subject: [PATCH] - Re-install blank trimming to have the xml test pass. Note that the problem if far more complex. To be revisited. modified: storage/connect/libdoc.cpp storage/connect/tabxml.h --- storage/connect/libdoc.cpp | 5 +++-- storage/connect/tabxml.h | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/storage/connect/libdoc.cpp b/storage/connect/libdoc.cpp index c0c917f544d..e094f935c80 100644 --- a/storage/connect/libdoc.cpp +++ b/storage/connect/libdoc.cpp @@ -469,12 +469,13 @@ char *XML2NODE::GetText(char *buf, int len) xmlFree(Content); if ((Content = xmlNodeGetContent(Nodep))) { + char *extra = " \t\r\n"; char *p1 = (char*)Content, *p2 = buf; bool b = false; // Copy content eliminating extra characters - for (; *p1 && (p2 - buf) < (len - 1); p1++) - if (strchr("\t\r\n", *p1)) { + for (; *p1 && (p2 - buf) < len; p1++) + if (strchr(extra, *p1)) { if (b) { // This to have one blank between sub-nodes *p2++ = ' '; diff --git a/storage/connect/tabxml.h b/storage/connect/tabxml.h index 70f050ed6f2..4c9fc27a8d7 100644 --- a/storage/connect/tabxml.h +++ b/storage/connect/tabxml.h @@ -40,13 +40,13 @@ class DllExport XMLDEF : public TABDEF { /* Logical table description */ char *Encoding; /* New XML table file encoding */ char *Tabname; /* Name of Table node */ char *Rowname; /* Name of first level nodes */ - char *Colname; /* Name of second level nodes */ + char *Colname; /* Name of second level nodes */ char *Mulnode; /* Name of multiple node */ char *XmlDB; /* Name of XML DB node */ - char *Nslist; /* List of namespaces to register */ + char *Nslist; /* List of namespaces to register */ char *DefNs; /* Dummy name of default namespace */ - char *Attrib; /* Table node attributes */ - char *Hdattr; /* Header node attributes */ + char *Attrib; /* Table node attributes */ + char *Hdattr; /* Header node attributes */ int Coltype; /* Default column type */ int Limit; /* Limit of multiple values */ int Header; /* n first rows are header rows */ @@ -77,7 +77,7 @@ class DllExport TDBXML : public TDBASE { virtual PTDB CopyOne(PTABS t); virtual int GetRecpos(void); virtual int GetProgCur(void) {return N;} - virtual PSZ GetFile(PGLOBAL g) {return Xfile;} + virtual PSZ GetFile(PGLOBAL g) {return Xfile;} virtual void SetFile(PGLOBAL g, PSZ fn) {Xfile = fn;} virtual void ResetDB(void) {N = 0;} virtual void ResetSize(void) {MaxSize = -1;} @@ -126,26 +126,26 @@ class DllExport TDBXML : public TDBASE { bool NewRow; // True when inserting a new row bool Hasnod; // True if rows have subnodes bool Write; // True for Insert and Update - bool Usedom; // True for DOM, False for libxml2 + bool Usedom; // True for DOM, False for libxml2 bool Bufdone; // True when column buffers allocated - bool Nodedone; // True when column nodes allocated - bool Skipnull; // True to skip writing nullnodes + bool Nodedone; // True when column nodes allocated + bool Skipnull; // True to skip writing nullnodes bool Void; // True if the file does not exist - char *Xfile; // The XML file + char *Xfile; // The XML file char *Enc; // New XML table file encoding char *Tabname; // Name of Table node char *Rowname; // Name of first level nodes - char *Colname; // Name of second level nodes + char *Colname; // Name of second level nodes char *Mulnode; // Name of multiple node char *XmlDB; // Name of XML DB node - char *Nslist; // List of namespaces to register + char *Nslist; // List of namespaces to register char *DefNs; // Dummy name of default namespace - char *Attrib; // Table node attribut(s) - char *Hdattr; // Header node attribut(s) + char *Attrib; // Table node attribut(s) + char *Hdattr; // Header node attribut(s) int Coltype; // Default column type int Limit; // Limit of multiple values int Header; // n first rows are header rows - int Nrow; // The table cardinality + int Nrow; // The table cardinality int Irow; // The current row index int Nsub; // The current subrow index int N; // The current Rowid @@ -188,7 +188,7 @@ class XMLCOL : public COLBLK { PXATTR Vxap; PXATTR AttNode; PTDBXML Tdbp; - char *Valbuf; // To the node value buffer + char *Valbuf; // To the node value buffer char *Xname; // The node or attribute name char* *Nodes; // The intermediate nodes int Type; // 0: Attribute, 1: Tag, 2: position