Mercurial > pidgin
diff libpurple/xmlnode.h @ 32037:114a98da1a5f
xmlnode: Fix some brokeness in xmlnode serialization with prefixed elements.
Basically we were treating node->xmlns as the default namespace, but
that isn't the case with prefexed elements. In our serialization,
I believe we were adding an extraneous xmlns='' to a prefixed element,
which changes the (default) namespace for its children. (It's been
a bit too long with this in my tree, so I've forgotten the exact details)
| author | Paul Aurich <paul@darkrain42.org> |
|---|---|
| date | Sun, 04 Sep 2011 18:52:18 +0000 |
| parents | 67addaf8677f |
| children | 8d3b5853b017 |
line wrap: on
line diff
--- a/libpurple/xmlnode.h Sun Sep 04 18:45:51 2011 +0000 +++ b/libpurple/xmlnode.h Sun Sep 04 18:52:18 2011 +0000 @@ -221,7 +221,26 @@ * @param node The node to get the namepsace from * @return The namespace of this node */ -const char *xmlnode_get_namespace(xmlnode *node); +const char *xmlnode_get_namespace(const xmlnode *node); + +/** + * Returns the current default namespace. The default + * namespace is the current namespace which applies to child + * elements which are unprefixed and which do not contain their + * own namespace. + * + * For example, given: + * <iq type='get' xmlns='jabber:client' xmlns:ns1='http://example.org/ns1'> + * <ns1:element><child1/></ns1:element> + * </iq> + * + * The default namespace of all nodes (including 'child1') is "jabber:client", + * though the namespace for 'element' is "http://example.org/ns1". + * + * @param node The node for which to return the default namespace + * @return The default namespace of this node + */ +const char *xmlnode_get_default_namespace(const xmlnode *node); /** * Sets the prefix of a node
