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

David Schmidt davewood at gmx.at
Fri Nov 13 13:41:52 GMT 2009


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>

*** xml2perl
$VAR1 = [
{
    './form.xml' => {
        'elements' => {
            'element' => [
            {
                'label' => 'Label1',
                    'type' => 'Text'
            },
            {
                'label' => 'Label2',
                'type' => 'Text'
            }
            ]
        },
            'indicator' => 'submit'
    }
}
];



More information about the HTML-FormFu mailing list