Mercurial > pidgin
diff libpurple/xmlnode.h @ 21285:78f3361f5e62
make our xmlnode preserve prefixes
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Sat, 10 Nov 2007 05:16:58 +0000 |
parents | bd60afa72fce |
children | eb0f36c3a58f |
line wrap: on
line diff
--- a/libpurple/xmlnode.h Sat Nov 10 04:52:20 2007 +0000 +++ b/libpurple/xmlnode.h Sat Nov 10 05:16:58 2007 +0000 @@ -55,6 +55,8 @@ struct _xmlnode *child; /**< The child node or @c NULL.*/ struct _xmlnode *lastchild; /**< The last child node or @c NULL.*/ struct _xmlnode *next; /**< The next node or @c NULL. */ + char *prefix; /**< The namespace prefix if any. */ + GHashTable *namespace_map; /**< The namespace map. */ }; /** @@ -154,6 +156,16 @@ void xmlnode_set_attrib(xmlnode *node, const char *attr, const char *value); /** + * Sets a prefixed attribute for a node + * + * @param node The node to set an attribute for. + * @param attr The name of the attribute to set + * @param xmlns The prefix of the attribute to ste + * @param value The value of the attribute + */ +void xmlnode_set_attrib_with_prefix(xmlnode *node, const char *attr, const char *prefix, const char *value); + +/** * Sets a namespaced attribute for a node * * @param node The node to set an attribute for. @@ -218,6 +230,22 @@ const char *xmlnode_get_namespace(xmlnode *node); /** + * Sets the prefix of a node + * + * @param node The node to qualify + * @param xmlns The prefix of the node + */ +void xmlnode_set_prefix(xmlnode *node, const char *prefix); + +/** + * Returns the prefix of a node + * + * @param node The node to get the prefix from + * @return The prefix of this node + */ +const char *xmlnode_get_prefix(xmlnode *node); + +/** * Returns the node in a string of xml. * * @param node The starting node to output.