I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2007-01-09 15:39:36-08 by schaafb
forcearray on attribute
Hi,
We are parsing the following structure and would like to fold the 'source' attribute:
<mc> <transmit source="abc"> <destination level="xxx" status="sss" /> <destination level="yyy" status="ttt" /> ...etc </transmit> <transmit source="def"> ...etc </mc>
For XMLin we use "forcearray => ['destination', 'source'] and keyattr => ['source']".

However with a single 'transmit' (and 'source') element, the 'source' element is not placed in an array and subsequently not folded. Is this the expected behavior? Is there another way to apply forcearray or a similar operation to the 'source' attribute?

Regards,
Benoît
Direct Responses: 4003 | Write a response
Posted on 2007-01-09 20:08:43-08 by grantm in response to 3997
Re: forcearray on attribute
The values you give to ForceArray should be element names not attribute names. So in your example, I would expect you want: ForceArray => [ 'transmit', 'destination' ]
Direct Responses: 4109 | Write a response
Posted on 2007-01-22 12:38:28-08 by schaafb in response to 4003
Re: forcearray on attribute
Yes, this works! Thanks,
Benoît
Direct Responses: Write a response