This XML newbie is looking for some advice on how ot work with bill-of-material type data structures in XML, where a part element is a parent another another part element, etc:
<Part> (assembly)
<Part> (sub-assembly)
<Part> (component)
I'm thinking that the schema would consist of a Part element that contained a ParentPart attribute similiar to a relation DB solution:
<Parts>
<Part ParentPart="PartB">PartD</Part>
<Part ParentPart="PartB">PartC</Part>
<Part ParentPart="PartA">PartB</Part>
<Part ParentPart="Top">PartA</Part>
</Parts>
The next problem I have is how to present this data in it's hierarchically structure with a template. I'm guessing that it would need to select where the ParentPart="Top" and then apply stylesheets with the Part name passed as a parameter - ParentPart = @Part.
This would need to work recursively since the number of levels in the hierarchy are unknown.
Could anyone steer me in the correct direction or post any examples of working with recursive data structures?
Thank you for your help,
Gary
<Part> (assembly)
<Part> (sub-assembly)
<Part> (component)
I'm thinking that the schema would consist of a Part element that contained a ParentPart attribute similiar to a relation DB solution:
<Parts>
<Part ParentPart="PartB">PartD</Part>
<Part ParentPart="PartB">PartC</Part>
<Part ParentPart="PartA">PartB</Part>
<Part ParentPart="Top">PartA</Part>
</Parts>
The next problem I have is how to present this data in it's hierarchically structure with a template. I'm guessing that it would need to select where the ParentPart="Top" and then apply stylesheets with the Part name passed as a parameter - ParentPart = @Part.
This would need to work recursively since the number of levels in the hierarchy are unknown.
Could anyone steer me in the correct direction or post any examples of working with recursive data structures?
Thank you for your help,
Gary