in reply to Re: XML Parsing Out of Memory error
in thread XML Parsing Out of Memory error
in the full code I check to see if this is a list of questions or not... But if you try that one out Question indeed is an array ref as my print would suggest.#!/usr/bin/perl use XML::Simple; use Data::Dumper; my $xml = qq|<?xml version="1.0" standalone="no"?> <!DOCTYPE document SYSTEM "whocares.dtd"> <document> <QuestionList> <Question> <Id>3</Id> <Text>Are dingos your friend?</Text> <Answer>Satisfactory</Answer> </Question> <Question> <Id>3</Id> <Text>Should I have hit preview a second time?</Text> <Answer>Yes</Answer> </Question> </QuestionList> <QuestionList> <Question> <Id>11</Id> <Text>Should this run out of memory?</Text> <Answer>No</Answer> </Question> </QuestionList> </document>|; my $xml_ref = XMLin($xml); print Dumper $xml_ref; print $xml_ref->{'QuestionList'}->{'Question'}->[0]->{'Answer'};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: XML Parsing Out of Memory error
by mirod (Canon) on Feb 28, 2002 at 17:37 UTC |