DomString DomNode::find_prefix(const DomString &namespace_uri) const { DomElement cur = to_element(); while (!cur.is_null()) { DomNamedNodeMap attributes = cur.get_attributes(); int size = attributes.get_length(); for (int index = 0; index < size; index++) { DomNode attribute = attributes.item(index); if (attribute.get_prefix() == "xmlns" && attribute.get_node_value() == namespace_uri) { return attribute.get_local_name(); } } cur = cur.get_parent_node().to_element(); } return DomString(); }