Hello all,
 I am trying to play with simple XML. I hace reated a file, and am trying to read it 
in using XML::Simple and write it out, but with no luck :O(. Can someone point me to 
the correct error.

Thanks in Advance,
Mark G

CODE:
#!PERl -w
use XML::Simple;
use Data::Dumper;
 
$ref = XMLin('.\NMS.xml', ForceArray => [ 'itemList', 'root' ,'menu' ],KeepRoot => 
1,KeyAttr =>"define" ) or die "$!\n";
print XMLout($ref, XMLDecl => 1,AttrIndent => 1);
exit;

FILE:

<?xml version="1.0" ?>
<root xmlns="http://localhost.com";>
    <menu>
        <define>
            <name>Simple XML</name>
            <comment></comment>
            <startPage>start</startPage>
            <display>auto1</display>
            <sortby>label</sortby>
            <pageList>
                <page>
                    <id>start</id>
                    <title>AIX</title>
                    <itemList>
                        <item>
                            <id>a_aix1</id>
                            <key>a</key>
                            <label>aix1</label>
                            <command>connect 1</command>
                        </item>
                    </itemList>
                </page>
            </pageList>
        </define>
    </menu>
</root>

Reply via email to