I use a Perl script with the module XML:Simple to parse an XML feed:
my $xml=XMLin($resp->content);
my $xml2 = $xml->{params}{param}{value}{array}{data}{value}{struct}{member};
print $xml2->{prod_id}{value}{int}; #works fine
print $xml2->{product_text}{value}{string}; #returns a hash reference (hash(0x...)
What have I to modify to get the text:
<div class="text"> <div class="text_products">sdfsdf</div> </div>
instead of a hash reference?
This is the XML data:
<?xml version="1.0" encoding="UTF-8" ?>
- <methodResponse>
- <params>
- <param>
- <value>
- <array>
- <data>
- <value>
- <struct>
- <member>
<name>product_text</name>
- <value>
<string><![CDATA[ <div class="text"> <div class="text_products">sdfsdf</div> </div> ]]></string>
</value>
</member>
- <member>
<name>prod_id</name>
- <value>
<int>1290</int>
</value>
</member>
- <member>.......