[Autogen-users] xml2ag, loops in template
Brought to you by:
bkorb
From: Manuel H <mo...@co...> - 2012-08-03 06:28:25
|
Hello! This is my first post on the list, so i want to give a short introduction on myself: i'm a software developer from Austria, mostly working on Web-Applications. My first contact with AutoGen was whilst devloping a TCL-Application, about one year ago. Since then i continued to use this package on and on and am slowly discovering the benefits of AutoOpts! My current aim is to create an (unofficial) SQL-generator for the Joomla!-CMS-project. For this, i'm using xml2ag (AutoGen 5.10 on Ubuntu 10) and discovered, that xml2ag probably hangs up when called without any arguments. But my current main problem is that i seem unable to loop through definitions. I would be glad for any help on this. My XML definitions are: <website template="joomla-2.5.6.tpl"> <defaults language="en-GB"> <category status="published"></category> </defaults> <categories> <category title="News"> Description <category title="Media"></category> </category> <category title="Internals"> Description </category> </categories> </website> My Template is: [+ AutoGen5 template sql +] [+ (get "template") +] [+ (get "defaults.language") +] [+ IF (len "categories") >= 1 +] [+ # Loop through categories +] [+ # FOR categories.category +] [+ # FOR categories.category (for-from 0) (for-to (len "categories.category")) +] [+ FOR categories.category (for-from 0) (for-to 2) +] [+ categories.category.title +] [+ ENDFOR categories.category +] [+ ENDIF +] Now the problem is that the template doesn't seem to loop through all defined categories. Not the nested category-definition is the problem -- i tried it already. Please help me with what i've missed! Thank you in advance! -Manuel |