summaryrefslogtreecommitdiff
path: root/src/xml-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml-parser.c')
-rw-r--r--src/xml-parser.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xml-parser.c b/src/xml-parser.c
index 3eae5b1..84cc204 100644
--- a/src/xml-parser.c
+++ b/src/xml-parser.c
@@ -152,6 +152,16 @@ xml_file_get_node_value (TXMLFile *file, const gchar *x_path)
return val;
}
+gchar *
+xml_file_get_node_value_with_default (TXMLFile *file, const gchar *x_path, const gchar *_default)
+{
+ gchar *s;
+
+ s = xml_file_get_node_value (file, x_path);
+
+ return s ? s : g_strdup (_default);
+}
+
/*
* xml_file_get_node_attribute: retrieve attribute value from XPath node