Hi,
I'm a beginner in perl.
I'm trying to get an element value in xml.
I'm using XML::Simple.
BODY{font:x-small 'Verdana';margin-right:1.5em} .c{cursor:hand} .b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none} .e{margin-left:1em;text-indent:-1em;margin-right:1em} .k{margin-left:1em;text-indent:-1em;margin-right:1em} .t{color:#990000} .xt{color:#990099} .ns{color:red} .dt{color:green} .m{color:blue} .tx{font-weight:bold} .db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier} .di{font:small Courier} .d{color:blue} .pi{color:blue} .cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888} .ci{font:small Courier;color:#888888} PRE{margin:0px;display:inline}
Code:
<?xml version="1.0" ?>
<resultset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="Customer_ID">1</field>
<field name="Name">ABC</field>
</row>
<row>
<field name="Customer_ID">2</field>
<field name="Name">DEF</field>
</row>
</resultset>
I'm trying to get the customer_ID value.
Code:
my $myXML = XMLin("/myxml.xml");
my $custid = $myXML->{row}->{field=>['Name'=>'DEF']}->{field=>['Customer_ID']}
Can someone tell me what did I do wrong?
