in reply to XMLSimple XMLout, formatting output

ForceContent => 1, I think. Of course, the result of XMLin will be different than what you presented.

Update: Yup.

use strict; use warnings; use XML::Simple qw( ); my $xml = <<'__EOI__'; <doc> <Last>Smith</Last> <First>First</First> </doc> __EOI__ my $xs = XML::Simple->new( ForceContent => 1, ); print( $xs->XMLout( $xs->XMLin($xml) ) );
<opt> <First>First</First> <Last>Smith</Last> </opt>

Replies are listed 'Best First'.
Re^2: XMLSimple XMLout, formatting output
by Rodster001 (Pilgrim) on Apr 01, 2009 at 20:10 UTC
    Well, ForceContent is an XMLin option. I am not using XMLin at all, just XMLout.
      Ah, then don't specify it. You'll still need to change the layout of your data. Good thing you have Perl handy.
        This is where I thought the problem was. I tried nesting it a few different ways (using hashes and arrays) but I couldn't get it quite right. Any ideas here? I couldn't find anything in the docs that explained how XMLout parsed the data structure.