Update of /cvsroot/monetdb/MonetDB5/src/modules/atoms
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11339/src/modules/atoms
Modified Files:
xml.mx
Log Message:
fix bug in handling xml elements with out pcdata
Index: xml.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/atoms/xml.mx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- xml.mx 30 Nov 2007 12:36:08 -0000 1.14
+++ xml.mx 5 Jan 2008 11:36:04 -0000 1.15
@@ -259,24 +259,27 @@
}
str
-XMLelement(xml *ret, str *name, str *nspace, xml *attr, xml *val)
+XMLelement(xml *ret, str *name, str *nspace, xml *attr, xml *Val)
{
+ char *val = *Val;
int len;
str buf= (str) GDKmalloc(len=2*strlen(*name) +
strlen(*nspace) + strlen(*attr)+
- strlen("<></> ")+strlen(*val)+1);
+ strlen("<></> ")+strlen(val)+1);
+ if (strNil(val)) /* todo short hand <elementname /> */
+ val = "";
if( strNil(*nspace) && strNil(*attr))
snprintf(buf, len,"<%s>%s</%s>",
- *name, *val, *name);
+ *name, val, *name);
else if( strNil(*nspace))
snprintf(buf, len,"<%s %s>%s</%s>",
- *name, *attr, *val, *name);
+ *name, *attr, val, *name);
else if( strNil(*attr))
snprintf(buf, len,"<%s %s>%s</%s>",
- *name, *nspace, *val, *name);
+ *name, *nspace, val, *name);
else
snprintf(buf, len,"<%s %s %s>%s</%s>",
- *name, *nspace, *attr, *val, *name);
+ *name, *nspace, *attr, val, *name);
*ret= buf;
return MAL_SUCCEED;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins