[html-formfu] Config with Config::Any::XML

David Schmidt davewood at gmx.at
Sat Nov 14 10:57:50 GMT 2009


On Fri, Nov 13, 2009 at 8:49 PM, Carl Franks <fireartist at gmail.com> wrote:
> 2009/11/13 David Schmidt <davewood at gmx.at>:
>> Hello list,
>>
>> I am trying to configure my forms with Config::Any::XML but I cannot
>> get the correct XML syntax.
>>
>> So far I tried loading a working Config::Any::General sample file and
>> compare it to my Config::Any::XML file but I just cant model anonymous
>> array references in XML. :)
>>
>> I want XML because I am dynamically creating the form config with XSLT
>> from a XML file and I want to stick to XML for everything
>>
>> I include the form.conf and form.xml files and how Config::Any loads
>> them into perl structures.
>>
>> thanks in advance
>>
>> david
>>
>> *** form.conf:
>> <elements>
>>    type   Text
>>    label   Label1
>> </elements>
>> <elements>
>>    type   Text
>>    label   Label2
>> </elements>
>> indicator   submit
>>
>> *** conf2perl
>> $VAR1 = [
>> {
>>    './form.conf' => {
>>        'elements' => [
>>        {
>>            'label' => 'Label1',
>>                'type' => 'Text'
>>        },
>>        {
>>            'label' => 'Label2',
>>            'type' => 'Text'
>>        }
>>        ],
>>            'indicator' => 'submit'
>>    }
>> }
>> ];
>>
>> *** form.xml
>> <?xml version="1.0"?>
>> <form>
>>    <elements>
>>    <element type="Text">
>>            <label>Label1</label>
>>    </element>
>>    <element type="Text">
>>            <label>Label2</label>
>>    </element>
>>    </elements>
>>    <indicator>submit</indicator>
>> </form>
>
> Hi,
> This seems to do the trick:
>
> <?xml version="1.0"?>
> <form>
>   <elements type="Text">
>           <label>Label1</label>
>   </elements>
>   <elements type="Text">
>           <label>Label2</label>
>   </elements>
>   <indicator>submit</indicator>
> </form>
>
> Cheers,
> Carl
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>

Hey Carl
No, I tried that before

Caught exception in IdeaChallenge::Controller::Forms->show "Error
parsing /home/kvm/ic/trunk/IdeaChallenge/root/forms/forms/show.xml:
Not a HASH reference at /usr/local/share/perl/5.10.0/Config/Any/XML.pm
line 67.
 at /usr/local/share/perl/5.10.0/HTML/FormFu/ObjectUtil.pm line 502"

greets
david

-- 
David Schmidt   |   http://www.fm5.at



More information about the HTML-FormFu mailing list