[Gnucash-changes] r13743 - gnucash/trunk - Generate the
gnc:count-data tags by hand so that the attribute will be
David Hampton
hampton at cvs.gnucash.org
Fri Apr 7 00:26:59 EDT 2006
Author: hampton
Date: 2006-04-07 00:26:59 -0400 (Fri, 07 Apr 2006)
New Revision: 13743
Trac: http://svn.gnucash.org/trac/changeset/13743
Modified:
gnucash/trunk/ChangeLog
gnucash/trunk/src/backend/file/io-gncxml-v2.c
Log:
Generate the gnc:count-data tags by hand so that the attribute will be
written properly with all versions of libxml2.
Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog 2006-04-07 04:21:02 UTC (rev 13742)
+++ gnucash/trunk/ChangeLog 2006-04-07 04:26:59 UTC (rev 13743)
@@ -1,3 +1,17 @@
+2006-04-07 David Hampton <hampton at employees.org>
+
+ * src/backend/file/io-gncxml-v2.c: The cvs version of libxml2
+ refuses to write attribute tags that don't have valid namespaces.
+ Since gnucash writes the root node of the XML data file by hand,
+ there's no node with namespaces that can be passed in to the code
+ that generates the gnc:count-data tags. These tags must be
+ generated by hand as well.
+
+ * src/backend/file/gnc-commodity-xml-v2.c: When writing a currency
+ to the data file, write the full commodity data block for backward
+ compatibility with 1.8, instead of just writing the quote source
+ information.
+
2006-04-05 David Hampton <hampton at employees.org>
* src/gnome-utils/gnc-main-window.c:
Modified: gnucash/trunk/src/backend/file/io-gncxml-v2.c
===================================================================
--- gnucash/trunk/src/backend/file/io-gncxml-v2.c 2006-04-07 04:21:02 UTC (rev 13742)
+++ gnucash/trunk/src/backend/file/io-gncxml-v2.c 2006-04-07 04:26:59 UTC (rev 13743)
@@ -779,12 +779,14 @@
while(type)
{
- xmlNodePtr node;
- char *val;
int amount = va_arg(ap, int);
if(amount != 0)
{
+#if GNUCASH_REALLY_BUILD_AN_XML_TREE_ON_OUTPUT
+ char *val;
+ xmlNodePtr node;
+
val = g_strdup_printf("%d", amount);
node = xmlNewNode(NULL, BAD_CAST COUNT_DATA_TAG);
@@ -801,6 +803,11 @@
g_free(val);
xmlFreeNode(node);
+#else
+ fprintf(out, "<%s %s=\"%s\">%d</%s>\n",
+ COUNT_DATA_TAG, "cd:type", type, amount, COUNT_DATA_TAG);
+#endif
+
}
type = va_arg(ap, char *);
More information about the gnucash-changes
mailing list