RapidXML Docs say:
function xml_node::next_sibling
Synopsis
xml_node<Ch>* next_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const;
Description
Gets next sibling node, optionally matching node name. Behaviour is undefined if node has no parent. Use parent() to test if node has a parent.
Parameters
name
Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
name_size
Size of name, in characters, or 0 to have size calculated automatically from string
case_sensitive
Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
Returns
Pointer to found sibling, or 0 if not found.
So dim->next_sibling()
does not modify dim itself. You have to type dim = dim->next_sibling()
as the final parameter of the for
loop.