Imported Upstream version 2.91.2
[platform/upstream/libxml++.git] / docs / manual / libxml++.xml
index 45816dc..fc8915b 100644 (file)
@@ -191,10 +191,8 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0)
     std::cout << indent << "     line = " << node->get_line() << std::endl;
 
     //Print attributes:
-    const auto attributes = nodeElement->get_attributes();
-    for(xmlpp::Element::AttributeList::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter)
+    for (const auto& attribute : nodeElement->get_attributes())
     {
-      const auto attribute = *iter;
       const auto namespace_prefix = attribute->get_namespace_prefix();
 
       std::cout << indent << "  Attribute ";
@@ -219,7 +217,6 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0)
   if(!nodeContent)
   {
     //Recurse through child nodes:
-    auto list = node->get_children();
     for(const auto& child : node->get_children())
     {
       print_node(child, indentation + 2); //recursive
@@ -304,7 +301,6 @@ int main(int argc, char* argv[])
 
   return EXIT_SUCCESS;
 }
-
 </programlisting>
 </para>
 <!-- end inserted example code -->