in reply to XML Attribute vs Element

If you want a simple value to be processed as an element, make it an array reference.
#!/usr/bin/perl use warnings; use strict; use XML::Simple; my $data = { e => ['element value'], a => 'attribute value' }; print XMLout($data, RootName => 'root'); __DATA__ <root a="attribute value"> <e>element value</e> </root>

Replies are listed 'Best First'.
Re^2: XML Attribute vs Element
by Sporti69 (Acolyte) on Nov 06, 2008 at 16:33 UTC
    I added some code so I can get the values of the attributes.
    I haven't used your code, I bumped into something else.
    All works, but why do my attributes + their values within <element> get printed out in double

    -Script
    -XML
    We're getting somewhere