On Tue, 1 Nov 2011 12:01:16 -0700 Chad Wallace <[email protected]> wrote:
> On Tue, 1 Nov 2011 12:40:17 +0100 > veeru reddy <[email protected]> wrote: > > > You didn't include the call to XML::Simple, but I have a feeling the > > problem is that you need to use ForceArray in XML::Simple, and then > > traverse the expected arrays. Without ForceArray, you'll sometimes > > get an array of hashes and sometimes just a hash (if there's only > > one). The man page for XML::Simple will explain it all. > > I tried like that but I am very new to perl and template toolkit, and > also to which elements i need to use force array. can you tel me and > aafter using force arrary i need to change for loop? because I am > learning so i asked this type of questions and also i dnt know how to > reply post so i sended mail to you. The elements I would give to ForceArray are the ones that can have multiple instances, like student. There can be one or many "student" elements in a single "electronics" element. Can there be more than one "electronics" element in a single "branch" element? And so on... Then for the ones that you've set ForceArray on, you need a for loop to iterate over that array one or more times and continue on beneath them, nesting the loops as needed. _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
