|No such thing as a small change|
Creating a tree from a parent child list, that also includes node specific properties...by bryank (Acolyte)
|on Jun 29, 2009 at 14:56 UTC||Need Help??|
bryank has asked for the wisdom of the Perl Monks concerning the following question:
I want to take a tab-delimited file, and create a tree out of it. This is a continuation on a similar question I had a week or two ago. Anyway, each line in the file contains parent child columns, in addition to properties that pertain to the child. When constructing the tree, I want all properties from a parent to inherit (ie., overide) the children properties (with the exception of node description). For example, if a parent node had a property of hidden, I'd want any children marked as such.
Here's an example -- below I have node ids (parent, child), followed by the title (description) of the child. After that are additional properties of child:
So in the above example, node id 110, aka 'Granny Smith', would keep its description, but have its other properties overwritten by what was in node 100.
I'd also like a way to indicate if a node was overwritten by its parent. Perhaps as an additional property.
Any tips appreciated.