title: Property tree: complete path and name
body: <p>I'd like to create a class that can be constructed from a property tree, as in this example:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;config&gt;
      &lt;name&gt;testing&lt;/name&gt;
      &lt;!-- Test property tree --&gt;
      &lt;lambda min="200000" max="200"&gt;100&lt;/lambda&gt;
  ...
  </code></pre>
  
  <p>That is easy with a property tree, but then I need to access two properties of a subtree, as in this class:</p>
  
  <pre><code>parameter::parameter(boost::property_tree::ptree t)
  {
      // Set the value
      value = t.get_value&lt;double&gt;();
  
      // ?????
      auto nodename = t.something();
  
      // ?????
      std::string nodepath = t.somethingelse();
  
      // Get the attributes (or empty)
      auto p = t.get_child("&lt;xmlattr&gt;", boost::property_tree::ptree());
  
      // If we have attributes, read them
      if (p != boost::property_tree::ptree())
      {
          min = t.get&lt;double&gt;("&lt;xmlattr&gt;.min");
          max = t.get&lt;double&gt;("&lt;xmlattr&gt;.max");
  
          if (min &gt; max)
              throw std::runtime_error("Min and max values invalid for the parameter " + nodename + ", path: " + nodepath);
      }
      else
      {
          min = +1.0;
          max = -1.0;
      }
  }
  
  // ... Someplace else
  lambda = parameter(config.get_child("config.lambda"));
  </code></pre>
  
  <p>In the XML the mim/max attributes for <code>lambda</code> are invalid, and I need to throw an exception that could be read as</p>
  
  <pre><code>Min and max values invalid for the parameter lambda, path: config.lambda
  </code></pre>
  
  <p>Of course I could just pass the string, but it would defat the purpose. I've tried messing around <code>t</code>'s iterator and <code>data</code>, but got nothing.</p>
  
  <p>Can I obtain those values from a <code>ptree</code>?</p>
  
  <p>Thanks!</p>