summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-12-19 19:01:36 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-12-19 19:01:36 +0000
commitdd3b7a3773c7eb210041fd2e88f908e755dde8ef (patch)
treeb39757bb79b7d642fc9fdf04f296d3c4410f3498
parent1ecf9e1123e9f566edb4607d6010b0f78c2c5340 (diff)
add nodes in reverse class order to get them in schema order
-rw-r--r--lasso/xml/xml.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index 906cb86e..e89ddae1 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -607,7 +607,7 @@ lasso_node_impl_get_xmlNode(LassoNode *node)
LassoNodeClass *class = LASSO_NODE_GET_CLASS(node);
xmlNode *xmlnode;
xmlNs *ns;
- GList *list_ns = NULL, *t;
+ GList *list_ns = NULL, *list_classes = NULL, *t;
if (class->node_data == NULL)
return NULL;
@@ -616,10 +616,17 @@ lasso_node_impl_get_xmlNode(LassoNode *node)
while (class && LASSO_IS_NODE_CLASS(class) && class->node_data) {
if (class->node_data->ns)
list_ns = g_list_append(list_ns, class->node_data->ns);
- lasso_node_build_xmlNode_from_snippets(node, xmlnode, class->node_data->snippets);
+ list_classes = g_list_append(list_classes, class);
class = g_type_class_peek_parent(class);
}
+ t = g_list_last(list_classes);
+ while (t) {
+ class = t->data;
+ lasso_node_build_xmlNode_from_snippets(node, xmlnode, class->node_data->snippets);
+ t = g_list_previous(t);
+ }
+
t = g_list_first(list_ns);
while (t) {
ns = t->data;