summaryrefslogtreecommitdiffstats
path: root/lasso
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-10-13 01:09:29 +0200
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-10-13 01:09:29 +0200
commitf69b561c47b0a49c3a7c119cfe5008e3724b2467 (patch)
tree5287b6258486c8dcf46cd009917ff7645bb2f960 /lasso
parentc6d4076599c05e74b3d4ccbd5a735f09d4a5000e (diff)
downloadlasso-f69b561c47b0a49c3a7c119cfe5008e3724b2467.tar.gz
lasso-f69b561c47b0a49c3a7c119cfe5008e3724b2467.tar.xz
lasso-f69b561c47b0a49c3a7c119cfe5008e3724b2467.zip
[xml] allow node classes to not defined their nodename, useful for simple Type
Diffstat (limited to 'lasso')
-rw-r--r--lasso/xml/xml.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index 8677c2de..62f16cac 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -1674,11 +1674,16 @@ lasso_node_impl_get_xmlNode(LassoNode *node, gboolean lasso_dump)
LassoNode *value_node;
struct XmlSnippet *version_snippet;
struct _CustomElement *custom_element;
+ LassoNodeClass *node_data_class = class;
- if (class->node_data == NULL)
+ while (node_data_class && node_data_class->node_data != NULL && node_data_class->node_data->node_name == NULL) {
+ node_data_class = g_type_class_peek_parent(node_data_class);
+ }
+ if (! node_data_class || node_data_class->node_data == NULL ||
+ node_data_class->node_data->node_name == NULL)
return NULL;
- xmlnode = xmlNewNode(NULL, (xmlChar*)class->node_data->node_name);
+ xmlnode = xmlNewNode(NULL, (xmlChar*)node_data_class->node_data->node_name);
custom_element = _lasso_node_get_custom_element(node);
/* collect namespaces in the order of ancestor classes, nearer first */
while (class && LASSO_IS_NODE_CLASS(class) && class->node_data) {