summaryrefslogtreecommitdiffstats
path: root/lasso/xml
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-03-27 16:51:50 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-03-27 16:51:50 +0000
commit4b9f6d83053cbce853ffaaffbe2ffa131820ece4 (patch)
treeddc6a4d7262d5efaba18e54b8fc167102f4d7bf6 /lasso/xml
parent9150b008cfb06b1a4d61047a4ca577714c9561c7 (diff)
downloadlasso-4b9f6d83053cbce853ffaaffbe2ffa131820ece4.tar.gz
lasso-4b9f6d83053cbce853ffaaffbe2ffa131820ece4.tar.xz
lasso-4b9f6d83053cbce853ffaaffbe2ffa131820ece4.zip
Core: add lasso_set_string_from_prop(char**,xmlNode*,..) function
Diffstat (limited to 'lasso/xml')
-rw-r--r--lasso/xml/private.h1
-rw-r--r--lasso/xml/tools.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/lasso/xml/private.h b/lasso/xml/private.h
index 6927229e..1214681a 100644
--- a/lasso/xml/private.h
+++ b/lasso/xml/private.h
@@ -229,6 +229,7 @@ xmlDocPtr lasso_xml_parse_memory_with_error(const char *buffer, int size, xmlErr
xmlSecKeyPtr lasso_xmlsec_load_key_info(xmlNode *key_descriptor);
char* lasso_xmlnode_to_string(xmlNode *node, gboolean format, int level);
gboolean lasso_string_to_xsd_integer(const char *str, long int *integer);
+void lasso_set_string_from_prop(char **str, xmlNode *node, xmlChar *name, xmlChar *ns);
#ifdef __cplusplus
}
diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c
index cf16e333..62c413c7 100644
--- a/lasso/xml/tools.c
+++ b/lasso/xml/tools.c
@@ -2164,3 +2164,17 @@ lasso_string_to_xsd_integer(const char *str, long int *integer)
return FALSE;
return TRUE;
}
+
+void
+lasso_set_string_from_prop(char **str, xmlNode *node, xmlChar *name, xmlChar *ns)
+{
+ xmlChar *value;
+
+ g_assert(str);
+ g_assert(node);
+ value = xmlGetNsProp(node, name, ns);
+ if (value) {
+ lasso_assign_string(*str, (char*)value);
+ }
+ lasso_release_xml_string(value);
+}