I have a recursive function reading a "table of contents" of documents from a database. I would like to print numbering with the document that reflects where the item is in the tree, e.g.
1. First item,
1.1 Child of first item,
1.1.1 Child of child of first item,
1.2 Child of first item,
2. Second item,
2.1 Child of second item,
etc.
Rather stumped about this at the moment - help please?