mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
rcxml: convert dotted properties into nested nodes before processing
For example, the following node:
<keybind name.action="ShowMenu" menu.action="root-menu"
x.position.action="1" y.position.action="2" />
is converted to:
<keybind>
<action>
<name>ShowMenu</name>
<menu>root-menu</menu>
<position>
<x>1</x>
<y>2</y>
</position>
</action>
</keybind>
...before processing the entire xml tree. This is a preparation to prevent
breaking changes when we refactor rcxml.c to use recursion instead of
encoding nodes into dotted strings.
This commit is contained in:
parent
330c55e1b2
commit
503af10505
6 changed files with 302 additions and 3 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include "common/parse-double.h"
|
||||
#include "common/string-helpers.h"
|
||||
#include "common/three-state.h"
|
||||
#include "common/xml.h"
|
||||
#include "config/default-bindings.h"
|
||||
#include "config/keybind.h"
|
||||
#include "config/libinput.h"
|
||||
|
|
@ -1509,7 +1510,9 @@ rcxml_parse_xml(struct buf *b)
|
|||
return;
|
||||
}
|
||||
struct parser_state init_state = {0};
|
||||
xml_tree_walk(xmlDocGetRootElement(d), &init_state);
|
||||
xmlNode *root = xmlDocGetRootElement(d);
|
||||
lab_xml_expand_dotted_attributes(root);
|
||||
xml_tree_walk(root, &init_state);
|
||||
xmlFreeDoc(d);
|
||||
xmlCleanupParser();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue