Boost logo

Boost Users :

Subject: [Boost-users] [property tree] Property Tree equivalent for matching nodes with specific child data?
From: Jesse Perla (jesseperla_at_[hidden])
Date: 2009-12-29 10:46:55


The property tree library looks like a very good way for me to remove the
tinyxpath and tinyxml dependencies in my project.

However, I am confused by one usage pattern. I have a lot of properties
like the following:
<top>
  <struct1 name="bla">
    <stuff> data specific to struct1 </stuff>
  <struct1/>
  <struct1 name="bla2">
    <stuff> data specific to struct1 </stuff>
  <struct1/>
  <struct2 name="bla3">
    <stuff2>data specific to struct2 </stuff2>
  <struct1/>
</top>

I need to be able to get the tree given the name. In xpath I would go
something like: ""/top/struct1[@name='bla']/stuff" to get at that
information. I realize I could embed a <name> underneath the struct1 in
xpath as well, but how do I get back to the siblings?

Any ideas on how best to use property tree for this kind of pattern?

Thanks,
Jesse



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net