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

4157dataof() use with index

Expand Messages
  • Martin Naskovski
    Nov 5, 2004
      Hi - I have this code:

      my @evtList;

      my $idx = 1;
      while ( defined $som->dataof("[$idx]") ) {
      my $eventXML = $som->dataof("[$idx]/event");

      Which basically takes MANY <regAPI> </regAPI>, elements in my XML stream,
      and the $idx is used to access each <regAPI> / </regAPI> pair as an array,
      by using 'dataof()' (or valueof() if you wish).

      The <regAPI> / <.regAPI> contains this:

      <event .... />

      My problem is, when I have a SOAP call which returns JUST ONE <regAPI> /
      </regAPI> , the above code does NOT work, so in order to get the 'event'
      part, I have to do:


      everytime I have a SINGLE <regAPI> pair.

      Why cant I just process even a SINGLE element as a list through my while
      loop, with only a signle iteration through it, and return a LIST with ONE
      element in it?

      Am I missing something, or is this not possible wit hthe SOAP::Lite xpath

    • Show all 2 messages in this topic