mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -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
29
include/common/xml.h
Normal file
29
include/common/xml.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef LABWC_XML_H
|
||||
#define LABWC_XML_H
|
||||
|
||||
#include <libxml/tree.h>
|
||||
|
||||
/*
|
||||
* Converts dotted attributes into nested nodes.
|
||||
* 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>
|
||||
*/
|
||||
void lab_xml_expand_dotted_attributes(xmlNode *root);
|
||||
|
||||
#endif /* LABWC_XML_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue