in reply to Re^2: Perl parsing XML using XML::Simple
in thread Perl parsing XML using XML::Simple

Ok, here's some advice: boil the program and example code down as small as possible but keep it working.

Something like this:

<myxml xmlns:xs='bla'> <xs:complexType name="AlternateSecurityIdentification1"> <xs:sequence> <xs:element name="Id" type="Max35Text"/> <xs:choice> <xs:element name="DmstIdSrc" type="CountryCode"/> <xs:element name="PrtryIdSrc" type="Max35Text"/> </xs:choice> </xs:sequence> </xs:complexType> </myxml>
Will parse.

Also:

foreach my $complex(keys %{$data->{'xs:complexType'}}) { print $complex; my $seq = $data->{'xs:complexType'}->{$complex}->{'xs:sequence'};
Is probably easier written as:
foreach my $subseq (values %{$data->{'xs:complexType'}}) { my $seq = $subseq->{'xs:sequence'};
Then print()/Dump() the data you've got at various stages and see which line(s) are causing problems.

Replies are listed 'Best First'.
Re^4: Perl parsing XML using XML::Simple
by thickice97 (Initiate) on Jan 22, 2008 at 23:03 UTC
    Thanks for the info. Will try that.