mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- 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
This commit is contained in:
@@ -469,12 +469,13 @@ char *XML2NODE::GetText(char *buf, int len)
|
|||||||
xmlFree(Content);
|
xmlFree(Content);
|
||||||
|
|
||||||
if ((Content = xmlNodeGetContent(Nodep))) {
|
if ((Content = xmlNodeGetContent(Nodep))) {
|
||||||
|
char *extra = " \t\r\n";
|
||||||
char *p1 = (char*)Content, *p2 = buf;
|
char *p1 = (char*)Content, *p2 = buf;
|
||||||
bool b = false;
|
bool b = false;
|
||||||
|
|
||||||
// Copy content eliminating extra characters
|
// Copy content eliminating extra characters
|
||||||
for (; *p1 && (p2 - buf) < (len - 1); p1++)
|
for (; *p1 && (p2 - buf) < len; p1++)
|
||||||
if (strchr("\t\r\n", *p1)) {
|
if (strchr(extra, *p1)) {
|
||||||
if (b) {
|
if (b) {
|
||||||
// This to have one blank between sub-nodes
|
// This to have one blank between sub-nodes
|
||||||
*p2++ = ' ';
|
*p2++ = ' ';
|
||||||
|
@@ -40,13 +40,13 @@ class DllExport XMLDEF : public TABDEF { /* Logical table description */
|
|||||||
char *Encoding; /* New XML table file encoding */
|
char *Encoding; /* New XML table file encoding */
|
||||||
char *Tabname; /* Name of Table node */
|
char *Tabname; /* Name of Table node */
|
||||||
char *Rowname; /* Name of first level nodes */
|
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 *Mulnode; /* Name of multiple node */
|
||||||
char *XmlDB; /* Name of XML DB 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 *DefNs; /* Dummy name of default namespace */
|
||||||
char *Attrib; /* Table node attributes */
|
char *Attrib; /* Table node attributes */
|
||||||
char *Hdattr; /* Header node attributes */
|
char *Hdattr; /* Header node attributes */
|
||||||
int Coltype; /* Default column type */
|
int Coltype; /* Default column type */
|
||||||
int Limit; /* Limit of multiple values */
|
int Limit; /* Limit of multiple values */
|
||||||
int Header; /* n first rows are header rows */
|
int Header; /* n first rows are header rows */
|
||||||
@@ -77,7 +77,7 @@ class DllExport TDBXML : public TDBASE {
|
|||||||
virtual PTDB CopyOne(PTABS t);
|
virtual PTDB CopyOne(PTABS t);
|
||||||
virtual int GetRecpos(void);
|
virtual int GetRecpos(void);
|
||||||
virtual int GetProgCur(void) {return N;}
|
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 SetFile(PGLOBAL g, PSZ fn) {Xfile = fn;}
|
||||||
virtual void ResetDB(void) {N = 0;}
|
virtual void ResetDB(void) {N = 0;}
|
||||||
virtual void ResetSize(void) {MaxSize = -1;}
|
virtual void ResetSize(void) {MaxSize = -1;}
|
||||||
@@ -126,26 +126,26 @@ class DllExport TDBXML : public TDBASE {
|
|||||||
bool NewRow; // True when inserting a new row
|
bool NewRow; // True when inserting a new row
|
||||||
bool Hasnod; // True if rows have subnodes
|
bool Hasnod; // True if rows have subnodes
|
||||||
bool Write; // True for Insert and Update
|
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 Bufdone; // True when column buffers allocated
|
||||||
bool Nodedone; // True when column nodes allocated
|
bool Nodedone; // True when column nodes allocated
|
||||||
bool Skipnull; // True to skip writing nullnodes
|
bool Skipnull; // True to skip writing nullnodes
|
||||||
bool Void; // True if the file does not exist
|
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 *Enc; // New XML table file encoding
|
||||||
char *Tabname; // Name of Table node
|
char *Tabname; // Name of Table node
|
||||||
char *Rowname; // Name of first level nodes
|
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 *Mulnode; // Name of multiple node
|
||||||
char *XmlDB; // Name of XML DB 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 *DefNs; // Dummy name of default namespace
|
||||||
char *Attrib; // Table node attribut(s)
|
char *Attrib; // Table node attribut(s)
|
||||||
char *Hdattr; // Header node attribut(s)
|
char *Hdattr; // Header node attribut(s)
|
||||||
int Coltype; // Default column type
|
int Coltype; // Default column type
|
||||||
int Limit; // Limit of multiple values
|
int Limit; // Limit of multiple values
|
||||||
int Header; // n first rows are header rows
|
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 Irow; // The current row index
|
||||||
int Nsub; // The current subrow index
|
int Nsub; // The current subrow index
|
||||||
int N; // The current Rowid
|
int N; // The current Rowid
|
||||||
@@ -188,7 +188,7 @@ class XMLCOL : public COLBLK {
|
|||||||
PXATTR Vxap;
|
PXATTR Vxap;
|
||||||
PXATTR AttNode;
|
PXATTR AttNode;
|
||||||
PTDBXML Tdbp;
|
PTDBXML Tdbp;
|
||||||
char *Valbuf; // To the node value buffer
|
char *Valbuf; // To the node value buffer
|
||||||
char *Xname; // The node or attribute name
|
char *Xname; // The node or attribute name
|
||||||
char* *Nodes; // The intermediate nodes
|
char* *Nodes; // The intermediate nodes
|
||||||
int Type; // 0: Attribute, 1: Tag, 2: position
|
int Type; // 0: Attribute, 1: Tag, 2: position
|
||||||
|
Reference in New Issue
Block a user