I�m trying to return a list of elements via TaglibHelper, the elements being
derived from a query. Ideally I�d like the final xml to look similar to;

<component>
    <name>blah</name>
    <description>blah</description>
</component>
    .
    .

So I tried;

my $hash_tmp = 
[{name=>"test_n1",discription=>"test_d1"},{name=>"test_n2",discription=>"tes
t_d2"},{name=>"test_n3",discription=>"test_d3"}];
return 
    {
    components => $hash_tmp,
     }

Which works, returning the xml below which is close enough;

<Component-Browser-item id="1">
    <discription>test_d1</discription>
    <name>test_n1</name>
</Component-Browser-item>
<Component-Browser-item id="2">
    <discription>test_d2</discription>
    <name>test_n2</name>
</Component-Browser-item><Component-Browser-item id="3">
    <discription>test_d3</discription>
    <name>test_n3</name>
</Component-Browser-item>


However I�m going to be adding to $hash_tmp in a loop, so to simulate for a
quick test I used;

push (@hash_tmp,{name=>"test_n1",discription=>"test_d1"});
push (@hash_tmp,{name=>"test_n2",discription=>"test_d2"});
push (@hash_tmp,{name=>"test_n3",discription=>"test_d3"});
return 
    {
    components => @hash_tmp,
     }

Unfortunately this doesn�t work so good, returning;

    <discription>test_d1</discription>
    <name>test_n1</name>
    <HASH(0x682510)>
    <discription>test_d3</discription>
    <name>test_n3</name>
    </HASH(0x682510)>

Whist getting the above to work would help, I doubt either is particularly
good solution. I was wondering if anybody had solved a similar problem, or
had any tip.

Thanks, 
    


Reply via email to