diff --git a/docs/src/details/xml/ui_elements/styles.rst b/docs/src/details/xml/ui_elements/styles.rst
index 3ae4e1a954..249c64b922 100644
--- a/docs/src/details/xml/ui_elements/styles.rst
+++ b/docs/src/details/xml/ui_elements/styles.rst
@@ -76,7 +76,12 @@ Local styles can be used directly, for example:
-Selectors are not supported for local style properties yet.
+Selectors are also supported for local style properties:
+
+.. code-block:: xml
+
+
+
Local Style Binding
diff --git a/docs/src/details/xml/xml/syntax.rst b/docs/src/details/xml/xml/syntax.rst
index dd70b902f4..0806a4b35a 100644
--- a/docs/src/details/xml/xml/syntax.rst
+++ b/docs/src/details/xml/xml/syntax.rst
@@ -5,28 +5,43 @@
Syntax
======
+Overview
+********
+The XML engine uses standard XML syntax; however, there are some
+special conventions for property names and values.
-Naming conventions
+Naming Conventions
******************
- A standard XML syntax is used.
- Lowercase letters with ``_`` separation are used for attribute names.
- Tag names follow the usual variable-name rules: they must start with a letter or
``'_'`` and the rest of the name may be comprised of letters, ``'_'`` and digits.
+- ``-`` is used to create compound names, e.g. ``lv_chart-series``
- The LVGL API is followed as much as possible, e.g., ``align="center"``, ``bg_color="0xff0000"``.
- For colors, all these syntaxes are supported (similar to CSS colors): ``0x112233``,
``#112233``, ``112233``, ``0x123``, ``#123``, ``123``. Note that like CSS,
``0x123``, ``#123`` and ``123`` all mean ``#112233``.
- ``params`` can be referenced with ``$``.
- ``consts`` can be referenced with ``#``.
-- ``styles`` can be attached to states and/or parts like this:
- ``styles="style1 style2:pressed style3:focused:scrollbar"``.
-- Local styles (i.e. styles that are stored within the Component and thus not shared
- by any other Components) can be used like this:
- ````.
+Property Names
+**************
+
+In most of the cases XML property names don't have special syntax.
+for example:
+
+.. code-block:: xml
+
+
+
+Local styles also support adding "selectors" to property names:
+
+.. code-block:: xml
+
+
Types
*****
@@ -133,10 +148,8 @@ Compound types
Types can be compound, meaning multiple options/types are possible. For example, for
width: ``type="px|%|content"``.
-
-Limiting accepted values
-------------------------
-
+Limiting Accepted Values
+************************
**Not supported yet; the examples below illustrate the planned syntax.**
@@ -146,3 +159,4 @@ For example:
- Enums: ``type="dir(top bottom)"``
- Colors: ``type="color(0xff0000 0x00ff00 0x0000ff)"``
- Strings: ``type="string('Ok' 'Cancel')``
+
diff --git a/examples/others/xml/view.xml b/examples/others/xml/view.xml
index 6d2b57bbae..f9acad72ba 100644
--- a/examples/others/xml/view.xml
+++ b/examples/others/xml/view.xml
@@ -9,11 +9,24 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/xml/lv_xml_component.c b/src/xml/lv_xml_component.c
index 82dede8276..88bc44d58a 100644
--- a/src/xml/lv_xml_component.c
+++ b/src/xml/lv_xml_component.c
@@ -282,7 +282,6 @@ lv_result_t lv_xml_component_unregister(const char * name)
}
lv_ll_clear(&scope->param_ll);
-
lv_xml_font_t * font;
LV_LL_READ(&scope->font_ll, font) {
lv_free((char *)font->name);
diff --git a/src/xml/lv_xml_style.c b/src/xml/lv_xml_style.c
index 287a8a6f76..d45b55a148 100644
--- a/src/xml/lv_xml_style.c
+++ b/src/xml/lv_xml_style.c
@@ -332,15 +332,15 @@ const char * lv_xml_style_string_process(char * txt, lv_style_selector_t * selec
{
*selector = 0;
- char * style_name = lv_xml_split_str(&txt, ':');
- char * selector_str = lv_xml_split_str(&txt, ':');
+ char * style_name = lv_xml_split_str(&txt, '-');
+ char * selector_str = lv_xml_split_str(&txt, '-');
while(selector_str != NULL) {
/* Handle different states and parts */
*selector |= lv_xml_style_state_to_enum(selector_str);
*selector |= lv_xml_style_part_to_enum(selector_str);
/* Move to the next token */
- selector_str = lv_xml_split_str(&txt, ':');
+ selector_str = lv_xml_split_str(&txt, '-');
}
return style_name;
diff --git a/tests/src/test_assets/xml/view2.xml b/tests/src/test_assets/xml/view2.xml
index c4a5cb2431..f3ab511701 100644
--- a/tests/src/test_assets/xml/view2.xml
+++ b/tests/src/test_assets/xml/view2.xml
@@ -26,7 +26,7 @@
-
+
diff --git a/tests/src/test_cases/xml/test_xml_general.c b/tests/src/test_cases/xml/test_xml_general.c
index b75e9d9cbb..d4e4d6895b 100644
--- a/tests/src/test_cases/xml/test_xml_general.c
+++ b/tests/src/test_cases/xml/test_xml_general.c
@@ -214,7 +214,7 @@ void test_xml_component_styles(void)
"