I need to generate an xml file where we have recursive node structure where I'm trying to limit the depth to '6'. This xml file is used for site navigationSample XML :[html][/html]Here is my datacapture.cfg[html]<script> function init() { IWEventRegistry.addItemHandler("/sitemap-xml/site/node", "onReplicantAdded", addContainer); } function addContainer(cntr_instance) { var cntr = cntr_instance.getName(); alert('adding the container'); } init();</script>SiteName Enter the site name.Level OneName Enter the Node NameLink Link[/html]So in the addContainer() I need to add another container replicant to the current container instance dynamically.Something like this :[html]Level OneName Enter the Node NameLink LinkLevel OneName Enter the Node NameLink Link[/html]How do I handle this?I looked at IWItem.addInstance but I'm not sure how to do that.Besides, since its recursive, how do I call the addItemHandler on all the child nodes as well?Any help would be appreciated.Thanks !
Instead, you need to statically write out your DCT with 6 nested levels of node replicants. (or use something called itemref in the DCT to do nesting, but I've killed my brain trying to understand that)
This structure is impossible to map to *static* DCT. The reason is that each node (except perhaps root one) in this *6 deep*Tree may have any number of siblings. Further, number of siblings on each level is unknown upfront and may differ from DCR to DCR.
I'm not seeing the problem...
Thank you all for the comments.I don't want to use a static DCT b'coz :1) Firstly, the DCT is going to be really nested and too messy.2) We don't know the level of nesting ( I just gave limit 6 as an example )3) If I want to add a new node level down the line I have to edit the DCT and the TPL accordingly.So I'm looking for some dynamic solution.Thanks !