This function allows to create a xml node from the provided xml content. This function is useful if it is required to create a node with a particular complex content, without going into the detail of creating all childs, attributes and content. Here is an example: axlError * error = NULL; axlNode * node = NULL; // parse document root = axl_node_parse_strings (error, "<child>", " <widget class=\"GtkLabel\" id=\"label4\">", " <property name=\"visible\">True</property>", " <property name=\"label\" translatable=\"yes\"><b>1. Seleccione el sistema:</b></property>", " <property name=\"use_underline\">False</property>", " <property name=\"use_markup\">True</property>", " <property name=\"justify\">GTK_JUSTIFY_LEFT</property>", " <property name=\"wrap\">False</property>", " <property name=\"selectable\">False</property>", " <property name=\"xalign\">0</property>", " <property name=\"yalign\">0.5</property>", " <property name=\"xpad\">0</property>", " <property name=\"ypad\">0</property>", " <property name=\"ellipsize\">PANGO_ELLIPSIZE_NONE</property>", " <property name=\"width_chars\">-1</property>", " <property name=\"single_line_mode\">False</property>", " <property name=\"angle\">0</property>", " </widget>", " <packing>", " <property name=\"padding\">0</property>", " <property name=\"expand\">False</property>", " <property name=\"fill\">False</property>", " </packing>", "</child>", NULL); if (root == NULL) { printf ("Error: unable to parse content, error: %s\n", axl_error_get (error)); axl_error_free (error); return; } // once finished, free the node axl_node_free (root);
|