Maxim has asked for the wisdom of the Perl Monks concerning the following question:
Here datause strict; use CGI ':standard'; use XML::Simple; use Data::Dumper; #Variables my $newval = 'Max'; my $categor = 'Vinegars'; my $oldval = 'Martin Pouret'; my $prodid = '600.54.01'; my $cats; if ($categor eq 'Coffee') { my $cat = (<DATA>); } elsif ($categor eq 'Vinegars') { $cats = (<DATA>); print "Hello world"; #exit 1; } elsif ($categor eq 'Seafood') { my $cat = (<DATA>); } elsif ($categor eq 'Pate') { my $cat = (<DATA>); } elsif ($categor eq 'Mustard') { my $cat = (<DATA>); } else { print "Sorry the category that you wanted to edited doesn' +t exist. Please contact your administrator. \n Thanks"; print "No data will be print"; exit 1; } my $cat = $cats; my $arrays = [qw/subcategory packaging_qty recipe descript +ion product paragraph comments channel brand conditionning product_id + heading photo/]; my $category = XMLin($cat, keyattr => 1, forcearray => $ar +rays); print Dumper($category)
===DATA=== <category name="Vinegars"> <subcategory name="Range Martin Pouret"> <comments><paragraph>Gourmet vinegar for Connoisseurs. Vin +egar as it was once and always should be!</paragraph></comments> <photo>images/vinegars.jpg</photo> <product>Vinegar <channel>D</channel> <channel>S</channel> <product_id>600.54.01</product_id> <brand>Martin Pouret</brand> <description>Red wine vinegar old reserve</description +> <conditionning unit="ml">500</conditionning> <packaging_qty>6</packaging_qty> </product> </subcategory> </category>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: not well-formed (invalid token)
by Prior Nacre V (Hermit) on Oct 04, 2004 at 07:51 UTC | |
by Maxim (Sexton) on Oct 04, 2004 at 08:42 UTC | |
by Prior Nacre V (Hermit) on Oct 04, 2004 at 10:53 UTC | |
by Maxim (Sexton) on Oct 05, 2004 at 08:54 UTC | |
|
Re: not well-formed (invalid token)
by cLive ;-) (Prior) on Oct 04, 2004 at 07:28 UTC | |
by Maxim (Sexton) on Oct 04, 2004 at 07:35 UTC | |
by Maxim (Sexton) on Oct 04, 2004 at 07:45 UTC |