Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] XML::Simple ForceArray problem

Expand Messages
  • Bill Walton
    Oops ;-( The structure of the file is actually: IDNum Sponsor A
    Message 1 of 1 , Dec 27, 2005
    View Source
    • 0 Attachment
      Oops ;-(

      The structure of the file is actually:

      <agency>Sponsor A</agency>
      <agency>Sponsor B</agency>
      <agency>Sponsor C</agency>

      ----- Original Message -----
      From: Bill Walton
      To: perl-beginner@yahoogroups.com
      Sent: Tuesday, December 27, 2005 3:53 PM
      Subject: [PBML] XML::Simple ForceArray problem


      I'm processing XML files and am having trouble accessing some of the data.

      The (simplified) file structure of the situation I'm having trouble with is:

      <lead_sponsor>Sponsor A</lead_sponsor>
      <collaborator>Sponsor B</collaborator>
      <collaborator>Sponsor C</collaborator>

      There is one occurrance of <lead_sponsor> in each file. There are zero or more occurrances of <collaborator>.

      I've tried using forcearray => ['sponsors'] in the XMLin statement, but when I try to get the number of items under <sponsors> using
      $ArraySize = @{$Study->{sponsors}};
      I always get '1' for $ArraySize.

      Additionally, while I don't get an error executing
      $TrialSponsor = $Study->{sponsors}[$i]->{agency};
      I get a "Use of unitialized value..." warning when I try to print $TrialSponsor.

      How can I access the second (third, fourth, etc.) occurrance of <collaborator>?

      Thanks in advance for your assistance.

      Best regards,

      [Non-text portions of this message have been removed]

      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html


      a.. Visit your group "perl-beginner" on the web.

      b.. To unsubscribe from this group, send an email to:

      c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.